Fix tests to account for savepoints caused by atomic wrapper.
This commit is contained in:
@@ -139,7 +139,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
|
||||
# to discover if something other than the DjangoXBlockUserStateClient
|
||||
# has written to the StudentModule (such as 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'):
|
||||
self.kvs.set(user_state_key('a_field'), 'new_value')
|
||||
self.assertEquals(1, StudentModule.objects.all().count())
|
||||
@@ -152,7 +152,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
|
||||
# to discover if something other than the DjangoXBlockUserStateClient
|
||||
# has written to the StudentModule (such as 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'):
|
||||
self.kvs.set(user_state_key('not_a_field'), 'new_value')
|
||||
self.assertEquals(1, StudentModule.objects.all().count())
|
||||
@@ -206,7 +206,7 @@ class TestStudentModuleStorage(OtherUserFailureTestMixin, TestCase):
|
||||
# We also need to read the database to discover if something other than the
|
||||
# DjangoXBlockUserStateClient has written to the StudentModule (such as
|
||||
# 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"):
|
||||
self.kvs.set_many(kv_dict)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user