def test_cannot_save_empty_appointment_time(self): appointment = Appointment(time=None) with self.assertRaises(ValidationError): appointment.save() appointment.full_clean()