コード例 #1
0
ファイル: test_data.py プロジェクト: tanyaxp/edx-platform
    def setUp(self):
        """
        Create a course, and enroll a student user and staff user.
        """
        super(RosterDataTest, self).setUp()
        self.course = CourseFactory.create()
        self.course_key = self.course.id

        self.student = UserFactory.build(
            username=self.STUDENT_USERNAME,
            email=self.STUDENT_EMAIL,
            password=self.STUDENT_PASSWORD,
        )
        self.student.save()
        UserProfileFactory.create(user=self.student, name=self.STUDENT_NAME)

        self.staff = UserFactory.build(
            username=self.STAFF_USERNAME,
            email=self.STAFF_EMAIL,
            password=self.STAFF_PASSWORD,
        )
        self.staff.save()
        UserProfileFactory.create(user=self.staff, name=self.STAFF_NAME)

        CourseEnrollment.enroll(self.student, self.course_key, mode="honor")
        CourseEnrollment.enroll(self.staff, self.course_key, mode="honor")
        CourseStaffRole(self.course_key).add_users(self.staff)
コード例 #2
0
ファイル: tests.py プロジェクト: idefs/edx-platform
    def setUp(self):
        self.factory = RequestFactory()
        self.course_id = 'Test/Course/Test'
        self.mode, created = self.create_mode('pay_with_coupon', 'Pay with coupon', min_price=100, currency='usd')
        self.coupon_name = 'test-coupon'
        self.coupon, created = self.create_coupon(self.coupon_name, 25)

        self.user = User.objects.create_user('test', '*****@*****.**', 'test')
        UserProfileFactory.create(user=self.user, name='Gary Test')
        self.client.login(username='******', password='******')

        class mock_customer(object):
            id = 'customer_test_id_32'
        self.mock_customer = mock_customer
コード例 #3
0
 def setUp(self):
     super(CertificateTests, self).setUp()
     self.course = CourseFactory.create()
     UserProfileFactory.create(user=self.user)
コード例 #4
0
ファイル: test_certificates.py プロジェクト: openfun/fun-apps
 def setUp(self):
     super(CertificateTests, self).setUp()
     self.course = CourseFactory.create()
     UserProfileFactory.create(user=self.user)