def test__init__no_submission_key(self): grouped_submission = GroupedSubmission(self.canvas._Canvas__requester, {'user_id': 1}) self.assertIsInstance(grouped_submission, GroupedSubmission) self.assertTrue(hasattr(grouped_submission, 'submissions')) self.assertIsInstance(grouped_submission.submissions, list) self.assertEqual(len(grouped_submission.submissions), 0)
def setUp(self): self.canvas = Canvas(settings.BASE_URL, settings.API_KEY) self.grouped_submission = GroupedSubmission( self.canvas._Canvas__requester, { 'user_id': 1, 'submissions': [{ 'id': 1, 'assignment_id': 1, 'user_id': 1, "html_url": "https://example.com/courses/1/assignments/1/submissions/1", "submission_type": "online_upload", }], }, )
def test__init__issue_303_regression(self): """ Regression test for issue #303 https://github.com/ucfopen/canvasapi/issues/303 """ grouped_submission = GroupedSubmission( self.canvas._Canvas__requester, { "user_id": 1, "submissions": [{ "id": 1, "assignments_id": 1, "user_id": 1, "html_url": "https://example.com/courses/1/assignments/1/submissions/1", "submission_type": "online_upload", }], }, ) self.assertTrue(hasattr(grouped_submission, "submissions")) self.assertIn("submissions", grouped_submission.attributes)