def test_lti_user_not_enrolled(self): """Test that user not enrolled yet""" lti_user = LTIUser(user_id=self.user.id, lti_consumer=self.lti_consumer, extra_data=json.dumps(self.headers), django_user=self.user) lti_user.save() self.role1.delete() self.assertFalse(lti_user.is_enrolled('student', self.course.id))
def test_lti_user_create_links(self): """Creating LTIUser without Django user Testing Django user creation process. """ lti_user = LTIUser(user_id=self.user.id, lti_consumer=self.lti_consumer, extra_data=json.dumps(self.headers)) lti_user.save() self.assertFalse(lti_user.is_linked) lti_user.create_links() self.assertTrue(lti_user.is_linked)
def test_lti_user(self): """Test enrollment process""" lti_user = LTIUser(user_id=self.user.id, lti_consumer=self.lti_consumer, extra_data=json.dumps(self.headers), django_user=self.user) lti_user.save() lti_user.enroll('student', self.course.id) self.assertTrue(lti_user.is_enrolled('student', self.course.id))
def test_lti_user_create_links(self): """Creating LTIUser without Django user Testing Django user creation process. """ lti_user = LTIUser(user_id=self.user.id, consumer='test_consumer', extra_data=json.dumps(self.headers), context_id=1) lti_user.save() self.assertFalse(lti_user.is_linked) lti_user.create_links() self.assertTrue(lti_user.is_linked)