Skip to content

Commit

Permalink
Fix phone numbers used in tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tillprochaska committed Aug 15, 2024
1 parent 1367077 commit b683010
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aleph/tests/test_entities_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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):
Expand Down

0 comments on commit b683010

Please sign in to comment.