- {% if user.has_anonymous_display_name() %} + {% if user.has_anonymous_display_name %}

{{ _('Please set your display name') }}

{{ _('Please set your display name or username to complete the registration process.') }}

diff --git a/src/olympia/users/tests/test_forms.py b/src/olympia/users/tests/test_forms.py index fbcd8883c9..a9f2f1b81e 100644 --- a/src/olympia/users/tests/test_forms.py +++ b/src/olympia/users/tests/test_forms.py @@ -62,12 +62,12 @@ class TestUserEditForm(UserFormBase): self.url = reverse('users.edit') def test_no_username_or_display_name(self): - assert not self.user.has_anonymous_username() + assert not self.user.has_anonymous_username data = {'username': '', 'email': 'jbalogh@mozilla.com'} response = self.client.post(self.url, data) self.assertNoFormErrors(response) - assert self.user.reload().has_anonymous_username() + assert self.user.reload().has_anonymous_username def test_change_username(self): assert self.user.username != 'new-username' diff --git a/src/olympia/users/tests/test_models.py b/src/olympia/users/tests/test_models.py index 8aef95ae94..9ecc9b230e 100644 --- a/src/olympia/users/tests/test_models.py +++ b/src/olympia/users/tests/test_models.py @@ -85,38 +85,38 @@ class TestUserProfile(TestCase): def test_has_anonymous_username_no_names(self): user = UserProfile(display_name=None) user.anonymize_username() - assert user.has_anonymous_username() + assert user.has_anonymous_username def test_has_anonymous_username_username_set(self): user = UserProfile(username='bob', display_name=None) - assert not user.has_anonymous_username() + assert not user.has_anonymous_username def test_has_anonymous_username_display_name_set(self): user = UserProfile(display_name='Bob Bobbertson') user.anonymize_username() - assert user.has_anonymous_username() + assert user.has_anonymous_username def test_has_anonymous_username_both_names_set(self): user = UserProfile(username='bob', display_name='Bob Bobbertson') - assert not user.has_anonymous_username() + assert not user.has_anonymous_username def test_has_anonymous_display_name_no_names(self): user = UserProfile(display_name=None) user.anonymize_username() - assert user.has_anonymous_display_name() + assert user.has_anonymous_display_name def test_has_anonymous_display_name_username_set(self): user = UserProfile(username='bob', display_name=None) - assert not user.has_anonymous_display_name() + assert not user.has_anonymous_display_name def test_has_anonymous_display_name_display_name_set(self): user = UserProfile(display_name='Bob Bobbertson') user.anonymize_username() - assert not user.has_anonymous_display_name() + assert not user.has_anonymous_display_name def test_has_anonymous_display_name_both_names_set(self): user = UserProfile(username='bob', display_name='Bob Bobbertson') - assert not user.has_anonymous_display_name() + assert not user.has_anonymous_display_name def test_add_admin_powers(self): user = UserProfile.objects.get(username='jbalogh')