def setUp(self): super(CertificatesViewsTests, self).setUp() self.client = Client() self.course = CourseFactory.create(org='testorg', number='run1', display_name='refundable course') self.course_id = self.course.location.course_key self.user = UserFactory.create(email='*****@*****.**', username='******', password='******') self.user.profile.name = "Joe User" self.user.profile.save() self.client.login(username=self.user.username, password='******') self.cert = GeneratedCertificate.objects.create( user=self.user, course_id=self.course_id, verify_uuid=uuid4(), download_uuid=uuid4(), grade="0.95", key='the_key', distinction=True, status='generated', mode='honor', name=self.user.profile.name, ) CertificateHtmlViewConfigurationFactory.create()
def setUp(self): super(CertificatesViewsTests, self).setUp() self.client = Client() self.course = CourseFactory.create( org='testorg', number='run1', display_name='refundable course' ) self.course_id = self.course.location.course_key self.user = UserFactory.create( email='*****@*****.**', username='******', password='******' ) self.user.profile.name = "Joe User" self.user.profile.save() self.client.login(username=self.user.username, password='******') self.request = RequestFactory().request() self.cert = GeneratedCertificateFactory.create( user=self.user, course_id=self.course_id, download_uuid=uuid4(), download_url="http://www.example.com/certificates/download", grade="0.95", key='the_key', distinction=True, status='downloadable', mode='honor', name=self.user.profile.name, ) CourseEnrollmentFactory.create( user=self.user, course_id=self.course_id ) CertificateHtmlViewConfigurationFactory.create() LinkedInAddToProfileConfigurationFactory.create()
def setUp(self): super(CertificatesViewsTests, self).setUp() self.client = Client() self.course = CourseFactory.create( org='testorg', number='run1', display_name='refundable course' ) self.course_id = self.course.location.course_key self.user = UserFactory.create( email='*****@*****.**', username='******', password='******' ) self.user.profile.name = "Joe User" self.user.profile.save() self.client.login(username=self.user.username, password='******') self.cert = GeneratedCertificate.objects.create( user=self.user, course_id=self.course_id, verify_uuid=uuid4(), download_uuid=uuid4(), grade="0.95", key='the_key', distinction=True, status='generated', mode='honor', name=self.user.profile.name, ) CertificateHtmlViewConfigurationFactory.create()