Changeset 1d92bf2 in OpenWorkouts-current for ow/tests/schemas/test_user.py


Ignore:
Timestamp:
Dec 16, 2018, 1:07:04 AM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
6560b8f
Parents:
929097a
Message:

(#37) Allow login using email address instead of username:

  • Use user uids as keys in the root folder for referencing user objects (instead of username)
  • Use uids for referencing users all over the place (auth, permissions, traversal urls, etc)
  • Replaced the username concept with nickname. This nickname will be used as a shortcut to access "public profile" pages for users
  • Reworked lots of basic methods in the OpenWorkouts root object (s/username/nickname, marked as properties some methods like users, emails, etc)
  • Added new add_user() and delete_user() helpers to the OpenWorkouts root object
  • Fixed bug in the dashboard redirect view, causing an endless loop if an authenticated user does not exist anymore when loading a page.
  • Lots of tests fixes, adaptations and catch up.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/tests/schemas/test_user.py

    r929097a r1d92bf2  
    44
    55from ow.models.user import User
    6 from ow.schemas.user import PasswordMatch, UniqueUsername, UniqueEmail
     6from ow.schemas.user import PasswordMatch, UniqueNickname, UniqueEmail
    77
    88
     
    2727
    2828
    29 class TestUniqueUsername(object):
     29class TestUniqueNickname(object):
    3030
    3131    @pytest.fixture
     
    3535
    3636    def test_validate_python_exists(self, state):
    37         validator = UniqueUsername()
     37        validator = UniqueNickname()
    3838        with pytest.raises(Invalid):
    3939            validator._validate_python('test', state)
     
    4242
    4343    def test_validate_python_not_exists(self, state):
    44         validator = UniqueUsername()
     44        validator = UniqueNickname()
    4545        res = validator._validate_python('not-existing', state)
    4646        assert res is None
Note: See TracChangeset for help on using the changeset viewer.