Beispiel #1
0
 def test_can_save_available_service(self):
     self.AVAILABLE_SERVICE_DATA['category'] = self.category.pk
     self.AVAILABLE_SERVICE_DATA['operator'] = self.operator.pk
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertTrue(form.is_valid())
Beispiel #2
0
 def test_cannot_save_available_service_operator_and_category_none(self):
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertFalse(form.is_valid())
Beispiel #3
0
 def test_cannot_save_available_service_category_not_found(self):
     self.AVAILABLE_SERVICE_DATA[
         'category'] = category_test_data.CATEGORY_NOT_FOUND_PK
     self.AVAILABLE_SERVICE_DATA['operator'] = self.operator.pk
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertFalse(form.is_valid())
Beispiel #4
0
 def test_cannot_save_available_service_operator_not_found(self):
     self.AVAILABLE_SERVICE_DATA['category'] = self.category.pk
     self.AVAILABLE_SERVICE_DATA[
         'operator'] = user_test_data.USER_NOT_FOUND_PK
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertFalse(form.is_valid())
Beispiel #5
0
 def test_cannot_save_available_service_operator_anonyme(self):
     self.AVAILABLE_SERVICE_DATA['category'] = self.category.pk
     self.AVAILABLE_SERVICE_DATA['operator'] = self.anonymeUser.pk
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertFalse(form.is_valid())
Beispiel #6
0
 def test_cannot_save_available_service_category_missing(self):
     self.AVAILABLE_SERVICE_DATA = available_service_test_data.AVAILABLE_SERVICE_DATA_MISSING_CATEGORY
     self.AVAILABLE_SERVICE_DATA['operator'] = self.operator.pk
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertFalse(form.is_valid())
Beispiel #7
0
 def test_cannot_save_available_service_operator_missing(self):
     self.AVAILABLE_SERVICE_DATA = available_service_test_data.AVAILABLE_SERVICE_DATA_MISSING_OPERATOR
     self.AVAILABLE_SERVICE_DATA['category'] = self.category.pk
     form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA)
     self.assertFalse(form.is_valid())