Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Dec 12, 2023
1 parent 31fcad5 commit df37d68
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions georiviere/portal/tests/test_views/test_sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ def test_sensitivity_detail_geojson_structure(self):
self.assertSetEqual(set(response.json().keys()), {'geometry', 'properties', 'type'})
self.assertEqual(response.json()['properties']['description'], 'nuk')

def test_sensitivity_detail_json_structure(self):
def test_sensitivity_detail_json_content_translated(self):
url = reverse('api_portal:sensitivities-detail',
kwargs={'pk': self.sensitivity.pk, 'lang': 'fr'})
response = self.client.get(url)
self.assertEqual(response.status_code, 200)

self.assertSetEqual(set(response.json().keys()), {'id', 'name', 'description', 'attachments', 'species'})
self.assertEqual(response.json()['description'], 'nuk')

def test_sensitivity_detail_geojson_structure_en(self):
Expand All @@ -38,13 +36,13 @@ def test_sensitivity_detail_geojson_structure_en(self):
self.assertSetEqual(set(response.json().keys()), {'geometry', 'properties', 'type'})
self.assertEqual(response.json()['properties']['description'], 'kun')

def test_sensitivity_detail_json_structure_en(self):
def test_sensitivity_detail_json_structure_translated(self):
url = reverse('api_portal:sensitivities-detail',
kwargs={'pk': self.sensitivity.pk, 'lang': 'en'})
response = self.client.get(url)
self.assertEqual(response.status_code, 200)

self.assertSetEqual(set(response.json().keys()), {'id', 'name', 'description', 'attachments', 'species'})
self.assertSetEqual(set(response.json().keys()), {'id', 'name', 'description', 'attachments', 'species', 'contact'})
self.assertEqual(response.json()['description'], 'kun')

def test_sensitivity_list_json_structure(self):
Expand All @@ -53,7 +51,7 @@ def test_sensitivity_list_json_structure(self):
response = self.client.get(url)
self.assertEqual(response.status_code, 200)

self.assertSetEqual(set(response.json()[0].keys()), {'id', 'name', 'description', 'attachments', 'species'})
self.assertSetEqual(set(response.json()[0].keys()), {'id', 'name', 'description', 'attachments', 'species', 'contact'})

def test_sensitivity_list_geojson_structure(self):
url = reverse('api_portal:sensitivities-list',
Expand Down

0 comments on commit df37d68

Please sign in to comment.