예제 #1
0
파일: tests.py 프로젝트: andrewkrug/oss2fa
    def setUp(self):
        super(EnrollmentModelTestCase, self).setUp()

        e = Enrollment()

        e.integration = Integration.objects.filter(
            name=BASE_TEST_INTEGRATION_NAME).first()

        e.policy = e.integration.policy
        e.username = BASE_TEST_USERNAME
        e.expires_at = timezone.now() + datetime.timedelta(minutes=10)

        e.save()
예제 #2
0
 def create(self, validated_data):
     enrollment = Enrollment()
     enrollment.course_id = self.initial_data.get('course_id')
     enrollment.student_id = self.initial_data.get('student_id')
     enrollment.save()
     return enrollment