Skip to content

Commit

Permalink
Fix test_copy_project
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Nov 28, 2024
1 parent 911ecea commit 4ad68c5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions rdmo/projects/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,18 @@ def test_copy_project(db, files):
'unit',
'external_id'
)
ordering = (
'attribute',
'set_prefix',
'set_index',
'collection_index'
)
for value_copy, value in zip(
project_copy.values.filter(snapshot=None),
project.values.filter(snapshot=None)
project_copy.values.filter(snapshot=None).order_by(*ordering),
project.values.filter(snapshot=None).order_by(*ordering)
):
for field in value_fields:
assert getattr(value_copy, field) == getattr(value, field)
assert getattr(value_copy, field) == getattr(value, field), field

if value_copy.file:
assert value_copy.file.path == value_copy.file.path.replace(
Expand All @@ -100,8 +106,8 @@ def test_copy_project(db, files):

for snapshot_copy, snapshot in zip(project_copy.snapshots.all(), project.snapshots.all()):
for value_copy, value in zip(
project_copy.values.filter(snapshot=snapshot_copy),
project.values.filter(snapshot=snapshot)
project_copy.values.filter(snapshot=snapshot_copy).order_by(*ordering),
project.values.filter(snapshot=snapshot).order_by(*ordering)
):
for field in value_fields:
assert getattr(value_copy, field) == getattr(value, field)
Expand Down

0 comments on commit 4ad68c5

Please sign in to comment.