@@ 50-76 (lines=27) @@ | ||
47 | qs.count(), count, |
|
48 | "Submission count for state %s is incorrect." % state) |
|
49 | ||
50 | def testGradedSubmissionsList(self): |
|
51 | # Expected number of results when the submission has that state |
|
52 | expected = ( |
|
53 | (0, Submission.RECEIVED), |
|
54 | (0, Submission.WITHDRAWN), |
|
55 | (0, Submission.SUBMITTED), |
|
56 | (0, Submission.TEST_VALIDITY_PENDING), |
|
57 | (0, Submission.TEST_VALIDITY_FAILED), |
|
58 | (0, Submission.TEST_FULL_PENDING), |
|
59 | (0, Submission.TEST_FULL_FAILED), |
|
60 | (0, Submission.SUBMITTED_TESTED), |
|
61 | (0, Submission.GRADING_IN_PROGRESS), |
|
62 | (1, Submission.GRADED), |
|
63 | (0, Submission.CLOSED), |
|
64 | (0, Submission.CLOSED_TEST_FULL_PENDING)) |
|
65 | ||
66 | # Course without submissions should not have gradable submissions |
|
67 | qs = self.course.graded_submissions() |
|
68 | self.assertEqual(qs.count(), 0) |
|
69 | ||
70 | for count, state in expected: |
|
71 | sub = create_submission(self.user, self.assignment) |
|
72 | sub.state = state |
|
73 | sub.save() |
|
74 | self.assertEqual( |
|
75 | qs.count(), count, |
|
76 | "Submission count for state %s is incorrect." % state) |
|
77 | ||
78 | def testCourseAuthors(self): |
|
79 | # Course without submissions should have no authors |
|
@@ 22-48 (lines=27) @@ | ||
19 | grading = create_pass_fail_grading() |
|
20 | self.assignment = create_open_assignment(self.course, grading) |
|
21 | ||
22 | def test_gradable_submissions_list(self): |
|
23 | # Expected number of results when the submission has that state |
|
24 | expected = ( |
|
25 | (0, Submission.RECEIVED), |
|
26 | (0, Submission.WITHDRAWN), |
|
27 | (1, Submission.SUBMITTED), |
|
28 | (0, Submission.TEST_VALIDITY_PENDING), |
|
29 | (0, Submission.TEST_VALIDITY_FAILED), |
|
30 | (0, Submission.TEST_FULL_PENDING), |
|
31 | (1, Submission.TEST_FULL_FAILED), |
|
32 | (1, Submission.SUBMITTED_TESTED), |
|
33 | (1, Submission.GRADING_IN_PROGRESS), |
|
34 | (0, Submission.GRADED), |
|
35 | (0, Submission.CLOSED), |
|
36 | (0, Submission.CLOSED_TEST_FULL_PENDING)) |
|
37 | ||
38 | # Course without submissions should not have gradable submissions |
|
39 | qs = self.course.gradable_submissions() |
|
40 | self.assertEqual(qs.count(), 0) |
|
41 | ||
42 | for count, state in expected: |
|
43 | sub = create_submission(self.user, self.assignment) |
|
44 | sub.state = state |
|
45 | sub.save() |
|
46 | self.assertEqual( |
|
47 | qs.count(), count, |
|
48 | "Submission count for state %s is incorrect." % state) |
|
49 | ||
50 | def testGradedSubmissionsList(self): |
|
51 | # Expected number of results when the submission has that state |