Skip to content

Commit

Permalink
fix deprecated assertDictContainsSubset
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Nov 25, 2024
1 parent fca1fc7 commit 59f23d6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions project/geosource/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def test_postgis_source_creation(self):
{**self.source_example, "db_password": "test_password"},
format="json",
)

data = response.json()
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertDictContainsSubset(self.source_example, response.json())
self.assertEqual(data, data | self.source_example)

@patch(
"project.geosource.serializers.PostGISSourceSerializer._first_record",
Expand Down Expand Up @@ -188,7 +188,8 @@ def test_postgis_source_creation_no_geom_field_good_geom(self):
)
self.source_example["geom_field"] = "foo"
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertDictContainsSubset(self.source_example, response.json())
data = response.json()
self.assertEqual(data, data | self.source_example)

@patch(
"project.geosource.serializers.requests.get",
Expand All @@ -209,7 +210,8 @@ def test_wmts_source_creation(self, mocked_request_get):
)

self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertDictContainsSubset(wmts_source, response.json())
data = response.json()
self.assertEqual(data, data | wmts_source)

@patch(
"project.geosource.serializers.PostGISSourceSerializer._first_record",
Expand Down

0 comments on commit 59f23d6

Please sign in to comment.