Commit 87b4bcc7 by John Eskew

Fix tests to account for savepoints caused by atomic wrapper.

parent 211cef08
...@@ -139,7 +139,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase): ...@@ -139,7 +139,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
# to discover if something other than the DjangoXBlockUserStateClient # to discover if something other than the DjangoXBlockUserStateClient
# has written to the StudentModule (such as UserStateCache setting the score # has written to the StudentModule (such as UserStateCache setting the score
# on the StudentModule). # on the StudentModule).
with self.assertNumQueries(2, using='default'): with self.assertNumQueries(4, using='default'):
with self.assertNumQueries(1, using='student_module_history'): with self.assertNumQueries(1, using='student_module_history'):
self.kvs.set(user_state_key('a_field'), 'new_value') self.kvs.set(user_state_key('a_field'), 'new_value')
self.assertEquals(1, StudentModule.objects.all().count()) self.assertEquals(1, StudentModule.objects.all().count())
...@@ -152,7 +152,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase): ...@@ -152,7 +152,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
# to discover if something other than the DjangoXBlockUserStateClient # to discover if something other than the DjangoXBlockUserStateClient
# has written to the StudentModule (such as UserStateCache setting the score # has written to the StudentModule (such as UserStateCache setting the score
# on the StudentModule). # on the StudentModule).
with self.assertNumQueries(2, using='default'): with self.assertNumQueries(4, using='default'):
with self.assertNumQueries(1, using='student_module_history'): with self.assertNumQueries(1, using='student_module_history'):
self.kvs.set(user_state_key('not_a_field'), 'new_value') self.kvs.set(user_state_key('not_a_field'), 'new_value')
self.assertEquals(1, StudentModule.objects.all().count()) self.assertEquals(1, StudentModule.objects.all().count())
...@@ -206,7 +206,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase): ...@@ -206,7 +206,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
# We also need to read the database to discover if something other than the # We also need to read the database to discover if something other than the
# DjangoXBlockUserStateClient has written to the StudentModule (such as # DjangoXBlockUserStateClient has written to the StudentModule (such as
# UserStateCache setting the score on the StudentModule). # UserStateCache setting the score on the StudentModule).
with self.assertNumQueries(2, using="default"): with self.assertNumQueries(4, using="default"):
with self.assertNumQueries(1, using="student_module_history"): with self.assertNumQueries(1, using="student_module_history"):
self.kvs.set_many(kv_dict) self.kvs.set_many(kv_dict)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment