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())
def test_cannot_save_available_service_operator_and_category_none(self): form = AvailableServiceCreationForm(self.AVAILABLE_SERVICE_DATA) self.assertFalse(form.is_valid())
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())
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())
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())
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())
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())