def setUp(self): super(StudentEngagementTests, self).setUp() self.user = UserFactory() self.user2 = UserFactory() self._create_course() initialize_notifications()
def test_notifications_publishing(self): initialize_notifications() # assert user has no notifications self.assertEqual(get_notifications_count_for_user(self.user.id), 0) course = self.setup_course_with_grading() module = self.get_module_for_user(self.user, course, course.homework_assignment) grade_dict = {'value': 0.5, 'max_value': 1, 'user_id': self.user.id} module.system.publish(module, 'grade', grade_dict) # user should have had a notification published as he/her is now in the # leaderboard self.assertEqual(get_notifications_count_for_user(self.user.id), 1)
def setUp(self): super(CourseModuleCompletionTests, self).setUp() self.user = UserFactory() self._create_course() initialize_notifications()