diff --git a/territories/serializers.py b/territories/serializers.py index 7b878ae..d892bf3 100644 --- a/territories/serializers.py +++ b/territories/serializers.py @@ -13,7 +13,7 @@ class Meta: class DepartmentSerializer(BBoxMixin): class Meta: model = Department - fields = ("id", "name", "bbox") + fields = ("id", "name", "code", "bbox") class AcademySerializer(BBoxMixin): diff --git a/tests/territories/test_api.py b/tests/territories/test_api.py index cad8113..c37da06 100644 --- a/tests/territories/test_api.py +++ b/tests/territories/test_api.py @@ -44,6 +44,7 @@ def test_get_territory_combined_list_filtered(self): { "id": mock.ANY, "name": "Rhône", + "code": "69", "bbox": { "xmin": 5.0, "ymin": 5.0, @@ -92,7 +93,14 @@ def test_get_departments_list(self): self.assertEqual( response.json(), - [{"id": mock.ANY, "name": "Rhône", "bbox": {"xmin": 5.0, "ymin": 5.0, "xmax": 10.0, "ymax": 10.0}}], + [ + { + "id": mock.ANY, + "name": "Rhône", + "code": "69", + "bbox": {"xmin": 5.0, "ymin": 5.0, "xmax": 10.0, "ymax": 10.0}, + } + ], ) def test_get_cities_list(self):