|
| 1 | +from datetime import timedelta |
| 2 | + |
1 | 3 | from django.test import TestCase
|
2 | 4 |
|
3 |
| -from appointment.tests.mixins.base_mixin import (AppointmentMixin, AppointmentRequestMixin, ServiceMixin, |
4 |
| - StaffMemberMixin, UserMixin) |
| 5 | +from appointment.tests.mixins.base_mixin import ( |
| 6 | + AppointmentMixin, AppointmentRequestMixin, ServiceMixin, StaffMemberMixin, UserMixin, |
| 7 | + AppointmentRescheduleHistoryMixin |
| 8 | +) |
5 | 9 |
|
6 | 10 |
|
7 |
| -class BaseTest(TestCase, UserMixin, StaffMemberMixin, ServiceMixin, AppointmentRequestMixin, AppointmentMixin): |
| 11 | +class BaseTest(TestCase, UserMixin, StaffMemberMixin, ServiceMixin, AppointmentRequestMixin, AppointmentMixin, |
| 12 | + AppointmentRescheduleHistoryMixin): |
8 | 13 | def setUp(self):
|
9 | 14 | # Users
|
10 | 15 | self. user1 = self. create_user_( email="[email protected]", username="tester1")
|
@@ -37,3 +42,16 @@ def create_appointment_for_user2(self, appointment_request=None):
|
37 | 42 | if not appointment_request:
|
38 | 43 | appointment_request = self.create_appt_request_for_sm2()
|
39 | 44 | return self.create_appointment_(user=self.client2, appointment_request=appointment_request)
|
| 45 | + |
| 46 | + def create_appointment_reschedule_for_user1(self, appointment_request=None, reason_for_rescheduling="Reason"): |
| 47 | + if not appointment_request: |
| 48 | + appointment_request = self.create_appt_request_for_sm1() |
| 49 | + date_ = appointment_request.date + timedelta(days=1) |
| 50 | + return self.create_reschedule_history_( |
| 51 | + appointment_request=appointment_request, |
| 52 | + date_=date_, |
| 53 | + start_time=appointment_request.start_time, |
| 54 | + end_time=appointment_request.end_time, |
| 55 | + staff_member=appointment_request.staff_member, |
| 56 | + reason_for_rescheduling=reason_for_rescheduling, |
| 57 | + ) |
0 commit comments