|
@@ -88,10 +88,6 @@ but invalid name %s was given" % badname):
|
88
|
88
|
self.assertEqual(set(fnames),
|
89
|
89
|
{'lastname', 'linked_texts', 'firstname', 'alias'})
|
90
|
90
|
|
91
|
|
- def test_insert(self):
|
92
|
|
- """ Testing insert method """
|
93
|
|
- dyncode.Person.insert({'lastname': 'foo', 'firstname': 'bar'})
|
94
|
|
-
|
95
|
91
|
def test_bad_insert(self):
|
96
|
92
|
""" Insert with bad arguments """
|
97
|
93
|
badargs = [
|
|
@@ -154,8 +150,7 @@ class LeObjectQueryMockTestCase(unittest.TestCase):
|
154
|
150
|
lodel_id = 1, firstname = "foo", lastname = "bar")
|
155
|
151
|
ret = inst.delete()
|
156
|
152
|
self.assertEqual(ret, 1, 'Bad return value forwarding')
|
157
|
|
- mock_execute.assert_called_once_with(
|
158
|
|
- dyncode.Person, [('lodel_id', '=', 1)], [])
|
|
153
|
+ mock_execute.assert_called_once_with()
|
159
|
154
|
|
160
|
155
|
def test_delete_bundle(self):
|
161
|
156
|
""" Checking that LeObject delete_bundle method calls LeDeleteQuery
|
|
@@ -171,9 +166,8 @@ class LeObjectQueryMockTestCase(unittest.TestCase):
|
171
|
166
|
dyncode.Person, ['lodel_id > 1'])
|
172
|
167
|
|
173
|
168
|
with patch.object(
|
174
|
|
- LeDeleteQuery, 'execute', return_value = None) as mock_execute:
|
|
169
|
+ LeDeleteQuery, 'execute', return_value = 1) as mock_execute:
|
175
|
170
|
|
176
|
171
|
dyncode.Person.delete_bundle(['lodel_id > 1'])
|
177
|
|
- mock_init.assert_called_once_with(
|
178
|
|
- dyncode.Person, [('lodel_id', '>', 1)], [])
|
|
172
|
+ mock_execute.assert_called_once_with()
|
179
|
173
|
|