Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.web.tests.add_forge_now.test_migration::Tests / Python tests / test_add_forge_now_denied_status_renamed_to_unsuccesful
Failed

TEST RESULT

Run At
Aug 17 2022, 10:28 AM
Details
migrator = <django_test_migrations.migrator.Migrator object at 0x7f47af4a4e80> def test_add_forge_now_denied_status_renamed_to_unsuccesful(migrator): state = migrator.apply_tested_migration((APP_LABEL, MIGRATION_0006)) Request = state.apps.get_model(APP_LABEL, "Request") from swh.web.add_forge_now.models import RequestStatus req = Request( status=RequestStatus.UNSUCCESSFUL, submitter_name="dudess", submitter_email="dudess@orga.org", forge_type="cgit", forge_url="https://example.org/forge", forge_contact_email="forge@//example.org", forge_contact_name="forge", forge_contact_comment=( "Discovered on the main forge homepag, following contact link." ), ) with pytest.raises(ValidationError): req.clean_fields() state = migrator.apply_tested_migration((APP_LABEL, MIGRATION_0007)) Request = state.apps.get_model(APP_LABEL, "Request") req = Request( status=RequestStatus.UNSUCCESSFUL, submitter_name="dudess", submitter_email="dudess@orga.org", forge_type="cgit", forge_url="https://example.org/forge", forge_contact_email="forge@//example.org", forge_contact_name="forge", forge_contact_comment=( "Discovered on the main forge homepag, following contact link." ), ) > req.clean_fields() .tox/py3/lib/python3.7/site-packages/swh/web/tests/add_forge_now/test_migration.py:211: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Request: Request object (None)>, exclude = [] def clean_fields(self, exclude=None): """ Clean all fields and raise a ValidationError containing a dict of all validation errors if any occur. """ if exclude is None: exclude = [] errors = {} for f in self._meta.fields: if f.name in exclude: continue # Skip validation for empty fields with blank=True. The developer # is responsible for making sure they have a valid value. raw_value = getattr(self, f.attname) if f.blank and raw_value in f.empty_values: continue try: setattr(self, f.attname, f.clean(raw_value, self)) except ValidationError as e: errors[f.name] = e.error_list if errors: > raise ValidationError(errors) E django.core.exceptions.ValidationError: {'status': ["Value 'RequestStatus.UNSUCCESSFUL' is not a valid choice."], 'forge_contact_email': ['Enter a valid email address.'], 'last_modified_date': ['This field cannot be blank.']} .tox/py3/lib/python3.7/site-packages/django/db/models/base.py:1231: ValidationError