From b68301080e795a08e7ee7d939ba877d6c03fc6e6 Mon Sep 17 00:00:00 2001 From: Till Prochaska <1512805+tillprochaska@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:42:26 +0200 Subject: [PATCH] Fix phone numbers used in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test started to fail with an upgrade of the `phonenumbers` package (imported via `followthemoney`) which included updated phone number validation rules. As a result, the phone numbers in this test case didn’t pass validation anymore and were cleaned from the entites created. At first glance these numbers seemed to be valid German mobile phone numbers and I was worried that there might be a regression in `phonenumbers`. But according to the International Telecommunication Union, a phone number with the prefix `176` has to be 11 digits long. I adjusted the tests accordingly. https://www.itu.int/oth/T0202000051/en --- aleph/tests/test_entities_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aleph/tests/test_entities_api.py b/aleph/tests/test_entities_api.py index 0ac46aa4ac..c081da3dfa 100644 --- a/aleph/tests/test_entities_api.py +++ b/aleph/tests/test_entities_api.py @@ -363,7 +363,7 @@ def test_entity_tags(self): "collection_id": self.col_id, "properties": { "name": "Blaaaa blubb", - "phone": ["+491769817271", "+491769817999"], + "phone": ["+4917698172710", "+4917698179990"], }, } resa = self.client.post( @@ -374,7 +374,7 @@ def test_entity_tags(self): "collection_id": self.col_id, "properties": { "name": "Nobody Man", - "phone": ["+491769817271", "+491769817777"], + "phone": ["+4917698172710", "+4917698177770"], }, } resa = self.client.post( @@ -385,7 +385,7 @@ def test_entity_tags(self): assert res.status_code == 200, (res.status_code, res.json) results = res.json["results"] assert len(results) == 1, results - assert results[0]["value"] == "+491769817271", results + assert results[0]["value"] == "+4917698172710", results validate(res.json["results"][0], "EntityTag") def test_undelete(self):