-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-display-by-default IA-2986: Have "sub org unit types to display" by default
- Loading branch information
Showing
6 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from iaso.gpkg.import_gpkg import import_gpkg_file | ||
from iaso.models import Account, Project | ||
from iaso.test import APITestCase | ||
from setuper.pyramid import update_org_unit_sub_type | ||
|
||
|
||
class OrgUnitImportFromGPKG(APITestCase): | ||
@classmethod | ||
def setUpTestData(cls): | ||
cls.account = Account.objects.create(name="a") | ||
cls.user_test = cls.create_user_with_profile(username="test", account=cls.account) | ||
cls.project = Project.objects.create(name="Project 1", account=cls.account, app_id="test_app_id") | ||
|
||
def test_minimal_import_with_sub_org_unit_type(self): | ||
import_gpkg_file( | ||
"./iaso/tests/fixtures/gpkg/minimal.gpkg", | ||
project_id=self.project.id, | ||
source_name="test", | ||
version_number=1, | ||
validation_status="new", | ||
description="", | ||
) | ||
self.client.force_authenticate(self.user_test) | ||
response = self.client.get("/api/v2/orgunittypes/") | ||
self.assertJSONResponse(response, 200) | ||
response_data = response.json() | ||
|
||
updated_with_sub_types = update_org_unit_sub_type(self.client, self.project.id, response_data["orgUnitTypes"]) | ||
|
||
for org_unit_type_with in updated_with_sub_types: | ||
self.assertJSONResponse(org_unit_type_with, 200) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters