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
8e1a7cdd
Commit
8e1a7cdd
authored
8 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
approaching visits without appointments are sorted by start date
parent
66426b81
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!24
Sort by date of visit lists
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/tests/test_view_notifications.py
+31
-4
31 additions, 4 deletions
smash/web/tests/test_view_notifications.py
smash/web/views/notifications.py
+1
-1
1 addition, 1 deletion
smash/web/views/notifications.py
with
32 additions
and
5 deletions
smash/web/tests/test_view_notifications.py
+
31
−
4
View file @
8e1a7cdd
...
...
@@ -7,11 +7,16 @@ from functions import create_appointment, create_location, create_worker, create
from
functions
import
create_subject
from
functions
import
create_visit
from
web.models
import
Appointment
,
Location
from
web.views.notifications
import
get_exceeded_visit_notifications_count
,
\
from
web.views.notifications
import
\
get_approaching_visits_for_mail_contact_count
,
\
get_approaching_visits_without_appointments
,
\
get_approaching_visits_without_appointments_count
,
\
get_subject_with_no_visit_notifications_count
,
get_unfinished_appointments_count
,
\
get_approaching_visits_for_mail_contact_count
,
get_subjects_with_reminder_count
,
\
get_visits_without_appointments_count
,
get_today_midnight_date
get_exceeded_visit_notifications_count
,
\
get_subject_with_no_visit_notifications_count
,
\
get_subjects_with_reminder_count
,
\
get_visits_without_appointments_count
,
\
get_today_midnight_date
,
\
get_unfinished_appointments_count
class
NotificationViewTests
(
TestCase
):
...
...
@@ -112,6 +117,28 @@ class NotificationViewTests(TestCase):
notification
=
get_approaching_visits_without_appointments_count
(
self
.
user
)
self
.
assertEquals
(
original_notification
.
count
+
1
,
notification
.
count
)
def
test_get_approaching_visits_without_appointments_order
(
self
):
subject
=
create_subject
()
visit
=
create_visit
(
subject
)
visit
.
datetime_begin
=
get_today_midnight_date
()
+
datetime
.
timedelta
(
days
=
10
)
visit
.
save
()
visit
=
create_visit
(
subject
)
visit
.
datetime_begin
=
get_today_midnight_date
()
+
datetime
.
timedelta
(
days
=
8
)
visit
.
save
()
visit
=
create_visit
(
subject
)
visit
.
datetime_begin
=
get_today_midnight_date
()
+
datetime
.
timedelta
(
days
=
12
)
visit
.
save
()
visits
=
get_approaching_visits_without_appointments
(
self
.
user
)
self
.
assertEquals
(
3
,
visits
.
count
())
# check sort order
self
.
assertTrue
(
visits
[
0
].
datetime_begin
<
visits
[
1
].
datetime_begin
)
self
.
assertTrue
(
visits
[
1
].
datetime_begin
<
visits
[
2
].
datetime_begin
)
def
test_get_subject_with_no_visit_notifications_count
(
self
):
original_notification
=
get_subject_with_no_visit_notifications_count
(
self
.
user
)
create_subject
()
...
...
This diff is collapsed.
Click to expand it.
smash/web/views/notifications.py
+
1
−
1
View file @
8e1a7cdd
...
...
@@ -163,7 +163,7 @@ def get_approaching_visits_without_appointments(user):
datetime_begin__lt
=
today_plus_two_months
,
is_finished
=
False
,
subject__default_location__in
=
get_filter_locations
(
user
),
my_count
=
0
)
my_count
=
0
)
.
order_by
(
'
datetime_begin
'
)
def
get_approaching_visits_for_mail_contact
(
user
):
...
...
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