Make more explicit syntaxis for test_with transaction test
This commit is contained in:
parent
c78d5e00b2
commit
39759c92ab
@ -117,9 +117,9 @@ class DatabaseTestCase(unittest.TestCase):
|
|||||||
def test_with(self):
|
def test_with(self):
|
||||||
init_length = len(self.db['weather'])
|
init_length = len(self.db['weather'])
|
||||||
try:
|
try:
|
||||||
with self.db:
|
with self.db as tx:
|
||||||
self.db['weather'].insert({'date': datetime(2011, 1, 1), 'temperature': 1, 'place': u'tmp_place'})
|
tx['weather'].insert({'date': datetime(2011, 1, 1), 'temperature': 1, 'place': u'tmp_place'})
|
||||||
self.db['weather'].insert({'date': True, 'temperature': 'wrong_value', 'place': u'tmp_place'})
|
tx['weather'].insert({'date': True, 'temperature': 'wrong_value', 'place': u'tmp_place'})
|
||||||
except SQLAlchemyError:
|
except SQLAlchemyError:
|
||||||
pass
|
pass
|
||||||
assert len(self.db['weather']) == init_length
|
assert len(self.db['weather']) == init_length
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user