Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
SMASCH
scheduling-system
Commits
24ff6af3
Commit
24ff6af3
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
common unit test initialization extracted
parent
0dbdadcc
No related branches found
No related tags found
1 merge request
!111
Resolve "Unfinished appointments"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/tests/api_views/test_appointment.py
+4
-12
4 additions, 12 deletions
smash/web/tests/api_views/test_appointment.py
with
4 additions
and
12 deletions
smash/web/tests/api_views/test_appointment.py
+
4
−
12
View file @
24ff6af3
...
@@ -3,28 +3,20 @@
...
@@ -3,28 +3,20 @@
import
datetime
import
datetime
import
json
import
json
from
django.contrib.auth.models
import
User
from
django.test
import
Client
from
django.test
import
TestCase
from
django.urls
import
reverse
from
django.urls
import
reverse
from
web.models
import
AppointmentTypeLink
,
AppointmentList
from
web.models
import
AppointmentTypeLink
,
AppointmentList
from
web.tests.functions
import
create_study_subject
,
create_worker
,
create_visit
,
create_appointment
,
\
from
web.tests
import
LoggedInWithWorkerTestCase
from
web.tests.functions
import
create_study_subject
,
create_visit
,
create_appointment
,
\
create_appointment_type
,
create_get_suffix
,
create_flying_team
create_appointment_type
,
create_get_suffix
,
create_flying_team
from
web.views.appointment
import
APPOINTMENT_LIST_GENERIC
,
APPOINTMENT_LIST_APPROACHING
,
APPOINTMENT_LIST_UNFINISHED
from
web.views.appointment
import
APPOINTMENT_LIST_GENERIC
,
APPOINTMENT_LIST_APPROACHING
,
APPOINTMENT_LIST_UNFINISHED
from
web.views.notifications
import
get_today_midnight_date
from
web.views.notifications
import
get_today_midnight_date
class
TestAppointmentApi
(
TestCase
):
class
TestAppointmentApi
(
LoggedInWithWorker
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
super
(
TestAppointmentApi
,
self
).
setUp
()
self
.
study_subject
=
create_study_subject
()
self
.
study_subject
=
create_study_subject
()
self
.
client
=
Client
()
username
=
'
piotr
'
password
=
'
top_secret
'
self
.
user
=
User
.
objects
.
create_user
(
username
=
username
,
email
=
'
jacob@bla
'
,
password
=
password
)
self
.
worker
=
create_worker
(
self
.
user
)
self
.
client
.
login
(
username
=
username
,
password
=
password
)
def
test_appointments_valid
(
self
):
def
test_appointments_valid
(
self
):
place
=
"
Some new flying team location
"
place
=
"
Some new flying team location
"
...
...
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