diff --git a/docs/schema.md b/docs/schema.md index 7d25f965..9f892019 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -11,7 +11,7 @@ zip: the user's home zip code age: the user's self reported age is_latino: enum of responses, see IsLatinoLabels in home/models/account.py is_sf_resident: true/false if the zip code is in the list of SF zip codes -is_tester: true if the user is a tested, automatically set if the name includes Tester +is_tester: true if the user is a tested, automatically set if the name includes IWT or iwt gender: enum of responses, see GenderLabels in home/models/account.py gender_other: freeform text response if gender is Other race: enum of responses, see RaceLabels in home/models/account.py diff --git a/home/tests/integration/appuser/test_create.py b/home/tests/integration/appuser/test_create.py index f67920c2..c95047c6 100644 --- a/home/tests/integration/appuser/test_create.py +++ b/home/tests/integration/appuser/test_create.py @@ -67,14 +67,14 @@ def test_create_tester_appuser_success(self): request_params = self.request_params.copy() request_params.update( { - "name": "Tester John", + "name": "IWT John", "zip": "94105", } ) expected_response = self.expected_response.copy() expected_response.update( { - "name": "Tester John", + "name": "IWT John", "zip": "94105", "is_tester": True, "is_sf_resident": True, diff --git a/home/tests/unit/api/test_appuser.py b/home/tests/unit/api/test_appuser.py index d79ffc34..e5a9d79f 100644 --- a/home/tests/unit/api/test_appuser.py +++ b/home/tests/unit/api/test_appuser.py @@ -6,14 +6,14 @@ class TestIsTester(TestCase): def test_is_tester(self): examples = [ - ("Tester A", True), - ("Test B", False), # are we sure this is the behavior we want? - ("tester c", True), - ("Testerosa", False), - ("tester-d", True), - ("Tester_E", True), - ("testrata", False), - ("tester", False), # are we sure this is the behavior we want? + ("Iwt A", True), + ("Test B", False), + ("iwt c", True), + ("Iwterosa", False), + ("iwt-d", True), + ("Iwt_E", True), + ("iwtrata", False), + ("iwt", True), ] for example, expected in examples: self.assertEqual( diff --git a/home/views/api/appuser.py b/home/views/api/appuser.py index 127b7aa8..2faf27ea 100644 --- a/home/views/api/appuser.py +++ b/home/views/api/appuser.py @@ -20,7 +20,7 @@ # Determines whether Account is tester account, based on name prefix def is_tester(name_field: str) -> bool: - possible_prefixes = ["tester-", "tester ", "tester_"] + possible_prefixes = ["iwt "] return any( [name_field.lower().startswith(prefix) for prefix in possible_prefixes] )