-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathfactories.py
35 lines (26 loc) · 1.01 KB
/
factories.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from factory import Sequence, SubFactory
from factory.django import DjangoModelFactory
from edx_proctoring.models import (
ProctoredExamSoftwareSecureComment,
ProctoredExamSoftwareSecureReview,
ProctoredExamSoftwareSecureReviewHistory
)
class ProctoredExamSoftwareSecureReviewFactory(DjangoModelFactory):
class Meta:
model = ProctoredExamSoftwareSecureReview
attempt_code = Sequence(lambda n: 'attempt_code_%d' % n)
review_status = 'review status'
raw_data = 'raw data'
encrypted_video_url = b'www.example.com'
class ProctoredExamSoftwareSecureReviewHistoryFactory(ProctoredExamSoftwareSecureReviewFactory):
class Meta:
model = ProctoredExamSoftwareSecureReviewHistory
class ProctoredExamSoftwareSecureCommentFactory(DjangoModelFactory):
class Meta:
model = ProctoredExamSoftwareSecureComment
review = SubFactory(ProctoredExamSoftwareSecureReviewFactory)
comment = 'comment'
status = 'status'
start_time = 100
stop_time = 150
duration = 150