Skip to content

Commit

Permalink
Merge pull request #1105 from rdmorganiser/1086-ci-tests-fail-sometim…
Browse files Browse the repository at this point in the history
…es-due-missing-testing-files

tests(projects): add files fixture to tests that use MEDIA_ROOT
  • Loading branch information
jochenklar authored Aug 8, 2024
2 parents 2b81726 + e58d841 commit 817d513
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rdmo/projects/tests/test_view_project_create_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def test_project_create_import_post_import_file_cancel(db, settings, client, fil


@pytest.mark.parametrize('username,password', users)
def test_project_create_import_post_import_empty(db, settings, client, username, password):
def test_project_create_import_post_import_empty(db, settings, files, client, username, password):
client.login(username=username, password=password)
projects_count = Project.objects.count()

Expand Down
4 changes: 2 additions & 2 deletions rdmo/projects/tests/test_view_project_update_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def test_project_update_import_post_import_file_cancel(db, settings, client, fil

@pytest.mark.parametrize('username,password', users)
@pytest.mark.parametrize('project_id', projects)
def test_project_update_import_post_import_file_empty(db, settings, client, username, password, project_id):
def test_project_update_import_post_import_file_empty(db, settings, files, client, username, password, project_id):
client.login(username=username, password=password)
projects_count = Project.objects.count()

Expand Down Expand Up @@ -368,7 +368,7 @@ def test_project_update_import_post_import_project_step1(db, settings, client, u
@pytest.mark.parametrize('username,password', users)
@pytest.mark.parametrize('project_id', projects)
@pytest.mark.parametrize('source_id', projects)
def test_project_update_import_post_import_project_step2(db, settings, client, username, password,
def test_project_update_import_post_import_project_step2(db, settings, files, client, username, password,
project_id, source_id):
client.login(username=username, password=password)
projects_count = Project.objects.count()
Expand Down
4 changes: 2 additions & 2 deletions rdmo/projects/tests/test_view_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_snapshot_create_post(db, client, files, username, password, project_id)
@pytest.mark.parametrize('username,password', users)
@pytest.mark.parametrize('project_id', projects)
@pytest.mark.parametrize('snapshot_id', snapshots)
def test_snapshot_update_get(db, client, username, password, project_id, snapshot_id):
def test_snapshot_update_get(db, client, files, username, password, project_id, snapshot_id):
client.login(username=username, password=password)
project = Project.objects.get(pk=project_id)

Expand All @@ -122,7 +122,7 @@ def test_snapshot_update_get(db, client, username, password, project_id, snapsho
@pytest.mark.parametrize('username,password', users)
@pytest.mark.parametrize('project_id', projects)
@pytest.mark.parametrize('snapshot_id', snapshots)
def test_snapshot_update_post(db, client, username, password, project_id, snapshot_id):
def test_snapshot_update_post(db, client, files, username, password, project_id, snapshot_id):
client.login(username=username, password=password)
project = Project.objects.get(pk=project_id)
snapshot = Snapshot.objects.get(pk=snapshot_id)
Expand Down
4 changes: 2 additions & 2 deletions rdmo/projects/tests/test_viewset_project_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_create(db, client, files, username, password, project_id):
@pytest.mark.parametrize('username,password', users)
@pytest.mark.parametrize('project_id', projects)
@pytest.mark.parametrize('snapshot_id', snapshots)
def test_update(db, client, username, password, project_id, snapshot_id):
def test_update(db, client, files, username, password, project_id, snapshot_id):
client.login(username=username, password=password)
project = Project.objects.get(id=project_id)
snapshot = Snapshot.objects.filter(project_id=project_id, id=snapshot_id).first()
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_update(db, client, username, password, project_id, snapshot_id):
@pytest.mark.parametrize('username,password', users)
@pytest.mark.parametrize('project_id', projects)
@pytest.mark.parametrize('snapshot_id', snapshots)
def test_delete(db, client, username, password, project_id, snapshot_id):
def test_delete(db, client, files, username, password, project_id, snapshot_id):
client.login(username=username, password=password)
project = Project.objects.get(id=project_id)

Expand Down

0 comments on commit 817d513

Please sign in to comment.