Merge lp:~adam-collard/storm/sqlobject2-compatibility into lp:storm

Proposed by Adam Collard
Status: Merged
Approved by: Benji York
Approved revision: 481
Merged at revision: 479
Proposed branch: lp:~adam-collard/storm/sqlobject2-compatibility
Merge into: lp:storm
Diff against target: 38 lines (+12/-12)
1 file modified
tests/sqlobject.py (+12/-12)
To merge this branch: bzr merge lp:~adam-collard/storm/sqlobject2-compatibility
Reviewer Review Type Date Requested Status
Adam Collard (community) Abstain
Benji York (community) Approve
Review via email: mp+287629@code.launchpad.net

Description of the change

Fix compatibility in Storm for SQLObject 2.x

Note tests on Xenial are still broken due to Django API changes - this will be addressed in a subsequent branch.

To post a comment you must log in.
481. By Adam Collard

Revert Ubuntu deps change for Django tests

Revision history for this message
Benji York (benji) wrote :

This change looks good -- and the tests even pass ;)

review: Approve
Revision history for this message
Adam Collard (adam-collard) :
review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/sqlobject.py'
2--- tests/sqlobject.py 2011-10-19 08:13:24 +0000
3+++ tests/sqlobject.py 2016-03-01 13:21:50 +0000
4@@ -344,7 +344,7 @@
5 self.assertEquals(nobody, None)
6
7 # SQLBuilder style expression:
8- person = self.Person.selectFirst(LIKE(self.Person.q.name, "John%"),
9+ person = self.Person.selectFirst(LIKE(self.Person.q.name, u"John%"),
10 orderBy="name")
11 self.assertNotEqual(person, None)
12 self.assertEqual(person.name, "John Doe")
13@@ -1207,15 +1207,15 @@
14 self.assertEquals(person.name, "John Moe")
15
16 def test_CONTAINSSTRING(self):
17- expr = CONTAINSSTRING(self.Person.q.name, "Do")
18- result = self.Person.select(expr)
19- self.assertEquals([person.name for person in result],
20- ["John Doe"])
21-
22- person.name = "Funny !%_ Name"
23-
24- expr = NOT(CONTAINSSTRING(self.Person.q.name, "!%_"))
25- result = self.Person.select(expr)
26- self.assertEquals([person.name for person in result],
27- ["John Joe"])
28+ expr = CONTAINSSTRING(self.Person.q.name, u"Do")
29+ result = self.Person.select(expr)
30+ self.assertEquals([person.name for person in result],
31+ [u"John Doe"])
32+
33+ person.name = u"Funny !%_ Name"
34+
35+ expr = NOT(CONTAINSSTRING(self.Person.q.name, u"!%_"))
36+ result = self.Person.select(expr)
37+ self.assertEquals([person.name for person in result],
38+ [u"John Joe"])
39

Subscribers

People subscribed via source and target branches

to status/vote changes: