Skip to content

Commit

Permalink
test: add GPX test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
paulschreiber committed Nov 28, 2023
1 parent cea7396 commit 2943dd4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions terraso_backend/tests/graphql/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ def data_entry_kml(users, groups):
)


@pytest.fixture
def data_entry_gpx(users, groups):
creator = users[0]
creator_group = groups[0]
creator_group.members.add(creator)
return mixer.blend(
DataEntry,
created_by=creator,
size=100,
groups=creator_group,
entry_type=DataEntry.ENTRY_TYPE_FILE,
resource_type="gpx",
)


@pytest.fixture
def data_entry_shapefile(users, groups):
creator = users[0]
Expand Down
16 changes: 16 additions & 0 deletions terraso_backend/tests/shared_data/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,19 @@ def visualization_config_kml(user):
),
created_by=user,
)


@pytest.fixture
def visualization_config_gpx(user):
return mixer.blend(
VisualizationConfig,
size=1,
data_entry=mixer.blend(
DataEntry,
size=1,
url=f"{settings.DATA_ENTRY_FILE_BASE_URL}/{user.id}/test_data.gpx",
created_by=user,
resource_type="gpx",
),
created_by=user,
)

0 comments on commit 2943dd4

Please sign in to comment.