Skip to content

Commit 10a6c8e

Browse files
committed
Fixed tests for pr #156
1 parent 7fac162 commit 10a6c8e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

appointment/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def clean(self):
316316
raise ValidationError(_("Start time and end time cannot be the same"))
317317

318318
# Ensure the date is not in the past:
319-
if self.date < datetime.date.today():
319+
if self.date and self.date < datetime.date.today():
320320
raise ValidationError(_("Date cannot be in the past"))
321321

322322
def save(self, *args, **kwargs):

appointment/tests/models/test_model_appointment_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_invalid_start_time(self):
2929
"""Start time must be before end time"""
3030
self.ar.start_time = time(11, 0)
3131
self.ar.end_time = time(9, 0)
32-
with self.assertRaises(ValueError):
32+
with self.assertRaises(ValidationError):
3333
self.ar.full_clean()
3434

3535
def test_invalid_payment_type(self):

0 commit comments

Comments
 (0)