SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
081c2deb
Commit
081c2deb
authored
7 years ago
by
Jorran de Wit
Browse files
Options
Downloads
Patches
Plain Diff
Add Report and RefereeInvitation factories
parent
3552a332
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
submissions/factories.py
+24
-1
24 additions, 1 deletion
submissions/factories.py
with
24 additions
and
1 deletion
submissions/factories.py
+
24
−
1
View file @
081c2deb
...
@@ -12,7 +12,7 @@ from .constants import STATUS_UNASSIGNED, STATUS_EIC_ASSIGNED, STATUS_RESUBMISSI
...
@@ -12,7 +12,7 @@ from .constants import STATUS_UNASSIGNED, STATUS_EIC_ASSIGNED, STATUS_RESUBMISSI
STATUS_PUBLISHED
,
SUBMISSION_TYPE
,
STATUS_RESUBMITTED
,
STATUS_VETTED
,
\
STATUS_PUBLISHED
,
SUBMISSION_TYPE
,
STATUS_RESUBMITTED
,
STATUS_VETTED
,
\
REFEREE_QUALIFICATION
,
RANKING_CHOICES
,
QUALITY_SPEC
,
REPORT_REC
,
\
REFEREE_QUALIFICATION
,
RANKING_CHOICES
,
QUALITY_SPEC
,
REPORT_REC
,
\
REPORT_STATUSES
,
STATUS_UNVETTED
,
STATUS_DRAFT
REPORT_STATUSES
,
STATUS_UNVETTED
,
STATUS_DRAFT
from
.models
import
Submission
,
Report
from
.models
import
Submission
,
Report
,
RefereeInvitation
from
faker
import
Faker
from
faker
import
Faker
...
@@ -182,3 +182,26 @@ class UnVettedReportFactory(ReportFactory):
...
@@ -182,3 +182,26 @@ class UnVettedReportFactory(ReportFactory):
class
VettedReportFactory
(
ReportFactory
):
class
VettedReportFactory
(
ReportFactory
):
status
=
STATUS_VETTED
status
=
STATUS_VETTED
class
RefereeInvitationFactory
(
factory
.
django
.
DjangoModelFactory
):
class
Meta
:
model
=
RefereeInvitation
submission
=
factory
.
SubFactory
(
'
submissions.factories.SubmissionFactory
'
)
referee
=
factory
.
Iterator
(
Contributor
.
objects
.
all
())
invitation_key
=
factory
.
Faker
(
'
md5
'
)
invited_by
=
factory
.
Iterator
(
Contributor
.
objects
.
all
())
@factory.post_generation
def
contributor_fields
(
self
,
create
,
extracted
,
**
kwargs
):
self
.
title
=
self
.
referee
.
title
self
.
first_name
=
self
.
referee
.
user
.
first_name
self
.
last_name
=
self
.
referee
.
user
.
last_name
self
.
email_address
=
self
.
referee
.
user
.
email
class
AcceptedRefereeInvitationFactory
(
RefereeInvitationFactory
):
accepted
=
True
date_responded
=
Faker
().
date_time_between
(
start_date
=
"
-1y
"
,
end_date
=
"
now
"
,
tzinfo
=
pytz
.
UTC
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment