Skip to content
Snippets Groups Projects
Commit 2a35b545 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

tests/api/origin_save: Explicitely populate SaveAuthorizedOrigin table

The use of django-test-migrations have some unexpected side effect
when building the debian package of swh-web, some default data
added to the SaveAuthorizedOrigin table in initial migrations
end up missing.

So ensure to explicitely fill that table with needed tests data
to avoid some test failures.

Related to T3266
parent 85253bc8
No related branches found
No related tags found
1 merge request!543tests/api/origin_save: Explicitely populate SaveAuthorizedOrigin table
......@@ -20,6 +20,7 @@ from swh.web.common.models import (
SAVE_TASK_SUCCEEDED,
VISIT_STATUS_FAILED,
VISIT_STATUS_FULL,
SaveAuthorizedOrigin,
SaveOriginRequest,
SaveUnauthorizedOrigin,
)
......@@ -31,6 +32,8 @@ pytestmark = pytest.mark.django_db
@pytest.fixture(autouse=True)
def populated_db():
SaveAuthorizedOrigin.objects.create(url="https://github.com/"),
SaveAuthorizedOrigin.objects.create(url="https://gitlab.com/"),
SaveUnauthorizedOrigin.objects.create(url="https://github.com/user/illegal_repo")
SaveUnauthorizedOrigin.objects.create(url="https://gitlab.com/user_to_exclude")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment