Skip to content

Commit

Permalink
Update test for client-side phone validation (#82)
Browse files Browse the repository at this point in the history
* Create valid US number
* Valid US number in fixture
* Assert client-side error message
* Update package version to 0.5.2
  • Loading branch information
oliverroick authored and seav committed Feb 16, 2018
1 parent 217e5fb commit f1acb72
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cadasta/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.1'
__version__ = '0.5.2'
2 changes: 1 addition & 1 deletion cadasta/test/account_tests/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def check_invalid_password(password):
password_input.send_keys(password)
self.click_register_button()
self.assert_form_field_has_error(
'password', 'Passwords cannot contain your phone.')
'password', 'Your password cannot contain your phone number.')

check_invalid_password('A' + self.phone)
check_invalid_password('A#' + self.phone[1:])
Expand Down
2 changes: 1 addition & 1 deletion cadasta/test/fixtures/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"is_superuser": false,
"username": "functest_genericphone_5q6aqy5usyf7d2u69bgt3qw7",
"email": null,
"phone": "+16428345185481",
"phone": "+16284597452",
"is_staff": false,
"is_active": true,
"date_joined": "2017-12-22T00:00:00.000Z",
Expand Down
4 changes: 2 additions & 2 deletions cadasta/test/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ def random_string():


def random_us_number():
rand_digits = [str(random.randint(0, 9)) for i in range(13)]
return '+1' + ''.join(rand_digits)
rand_digits = [str(random.randint(0, 9)) for i in range(7)]
return '+1628' + ''.join(rand_digits)

0 comments on commit f1acb72

Please sign in to comment.