def _test(self, controller_name): contest = Contest.objects.get() contest.controller.name = controller_name contest.save() test_env = create_environ() test_env['problem_instance_id'] = 1 test_env['round_id'] = 1 test_env['contest_id'] = contest.id url = reverse('default_ranking', kwargs={'contest_id': contest.id}) for i in [1, 3, 4]: test_env['submission_id'] = i update_user_results(test_env) self.assertTrue(self.client.login(username='******')) response = self.client.get(url) self.assertContains(response, 'Test User') self.assertNotContains(response, 'Test User 2') self.assertContains(response, '34')
def _test(self, controller_name): contest = Contest.objects.get() contest.controller.name = controller_name contest.save() test_env = {} test_env['problem_instance_id'] = 1 test_env['round_id'] = 1 test_env['contest_id'] = contest.id url = reverse('default_ranking', kwargs={'contest_id': contest.id}) for i in range(1,3): test_env['submission_id'] = i update_user_results(test_env) self.client.login(username='******') response = self.client.get(url) self.assertIn('Test User', response.content) self.assertNotIn('Test User 2', response.content) self.assertIn('34', response.content)