def setUp(self): self.score_encoding = test_score_encoding.create_score_encoding() self.global_id = self.score_encoding.global_id self.tutor = test_tutor.create_tutor() self.tutor.person.user = data_for_tests.create_user() self.tutor.person.save() perm = Permission.objects.get(codename="is_tutor") self.tutor.person.user.user_permissions.add(perm)
def setUp(self): self.score_encoding = test_score_encoding.create_score_encoding() self.global_id = self.score_encoding.global_id self.tutor = test_tutor.create_tutor() self.tutor.person.user = data_for_tests.create_user() self.tutor.person.save() perm = Permission.objects.get(codename="is_tutor") self.tutor.person.user.user_permissions.add(perm)
def test_get_score_sheet_if_present_in_db_but_outdated(self, mock_client_call): global_id = "12012" new_score_encoding = test_score_encoding.create_score_encoding(global_id=global_id) new_score_encoding.document = test_score_encoding.get_old_sample() new_score_encoding.save() expected = test_score_encoding.get_sample() mock_client_call.return_value = expected.encode("utf-8") document = score_encoding.get_score_sheet(global_id) self.assertJSONEqual(document, expected, "Should fetch document from queue")
def test_get_score_sheet_if_present_in_db_but_outdated( self, mock_client_call): global_id = "12012" new_score_encoding = test_score_encoding.create_score_encoding( global_id=global_id) new_score_encoding.document = test_score_encoding.get_old_sample() new_score_encoding.save() expected = test_score_encoding.get_sample() mock_client_call.return_value = expected.encode("utf-8") document = score_encoding.get_score_sheet(global_id) self.assertJSONEqual(document, expected, "Should fetch document from queue")
def setUp(self): self.score_encoding = test_score_encoding.create_score_encoding() self.global_id = self.score_encoding.global_id
def setUp(self): self.score_encoding = test_score_encoding.create_score_encoding() self.global_id = self.score_encoding.global_id