|
30 | 30 | from appointment.utils.db_helpers import Service, WorkingHours, create_user_with_username
|
31 | 31 | from appointment.utils.error_codes import ErrorCode
|
32 | 32 | from appointment.views import (
|
33 |
| - create_appointment, get_appointment_data_from_post_request, get_client_data_from_post, |
| 33 | + create_appointment, get_client_data_from_post, |
34 | 34 | redirect_to_payment_or_thank_you_page, verify_user_and_login
|
35 | 35 | )
|
36 | 36 |
|
@@ -1045,57 +1045,6 @@ def test_notify_admin_about_reschedule_called(self, mock_notify_admin):
|
1045 | 1045 | self.assertTrue(mock_notify_admin.called)
|
1046 | 1046 |
|
1047 | 1047 |
|
1048 |
| -class GetAppointmentDataFromPostRequestTests(BaseTest): |
1049 |
| - def setUp(self): |
1050 |
| - self.factory = RequestFactory() |
1051 |
| - self.post_data = { |
1052 |
| - 'phone': '1234567890', |
1053 |
| - 'want_reminder': 'on', |
1054 |
| - 'address': '123 Test St, Test City', |
1055 |
| - 'additional_info': 'Please ring the bell.' |
1056 |
| - } |
1057 |
| - |
1058 |
| - def test_get_appointment_data_from_post_request_with_data(self): |
1059 |
| - """Test retrieving appointment data from a POST request with all data provided.""" |
1060 |
| - request = self.factory.post('/fake-url/', self.post_data) |
1061 |
| - |
1062 |
| - appointment_data = get_appointment_data_from_post_request(request) |
1063 |
| - |
1064 |
| - self.assertEqual(appointment_data['phone'], self.post_data['phone']) |
1065 |
| - self.assertTrue(appointment_data['want_reminder']) |
1066 |
| - self.assertEqual(appointment_data['address'], self.post_data['address']) |
1067 |
| - self.assertEqual(appointment_data['additional_info'], self.post_data['additional_info']) |
1068 |
| - |
1069 |
| - def test_get_appointment_data_from_post_request_partial_data(self): |
1070 |
| - """Test retrieving appointment data from a POST request with partial data provided.""" |
1071 |
| - partial_post_data = { |
1072 |
| - 'phone': '1234567890', |
1073 |
| - # 'want_reminder' omitted to simulate unchecked checkbox |
1074 |
| - 'address': '123 Test St, Test City', |
1075 |
| - # 'additional_info' omitted to simulate empty field |
1076 |
| - } |
1077 |
| - request = self.factory.post('/fake-url/', partial_post_data) |
1078 |
| - |
1079 |
| - appointment_data = get_appointment_data_from_post_request(request) |
1080 |
| - |
1081 |
| - self.assertEqual(appointment_data['phone'], partial_post_data['phone']) |
1082 |
| - self.assertFalse(appointment_data['want_reminder'], "want_reminder should be False if not 'on'") |
1083 |
| - self.assertEqual(appointment_data['address'], partial_post_data['address']) |
1084 |
| - self.assertEqual(appointment_data['additional_info'], None, "additional_info should be None if not provided") |
1085 |
| - |
1086 |
| - def test_get_appointment_data_from_post_request_missing_data(self): |
1087 |
| - """Test retrieving appointment data from a POST request with missing data.""" |
1088 |
| - missing_data_post = {} |
1089 |
| - request = self.factory.post('/fake-url/', missing_data_post) |
1090 |
| - |
1091 |
| - appointment_data = get_appointment_data_from_post_request(request) |
1092 |
| - |
1093 |
| - self.assertEqual(appointment_data['phone'], None, "phone should be None if not provided") |
1094 |
| - self.assertFalse(appointment_data['want_reminder'], "want_reminder should be False if not provided") |
1095 |
| - self.assertEqual(appointment_data['address'], None, "address should be None if not provided") |
1096 |
| - self.assertEqual(appointment_data['additional_info'], None, "additional_info should be None if not provided") |
1097 |
| - |
1098 |
| - |
1099 | 1048 | class GetClientDataFromPostTests(BaseTest):
|
1100 | 1049 | def setUp(self):
|
1101 | 1050 | self.factory = RequestFactory()
|
|
0 commit comments