Changeset 1d92bf2 in OpenWorkouts-current for ow/tests/test_catalog.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/test_catalog.py

    r929097a r1d92bf2  
    5656        changes = update_indexes(catalog, indexes)
    5757        assert changes['added'] == ['newindex']
    58         assert changes['removed'] == ['sport']
     58        assert changes['removed'] == ['email', 'sport']
    5959
    6060    def test_update_indexes_empty(self, root):
     
    6363        changes = update_indexes(catalog, indexes)
    6464        assert changes['added'] == []
    65         assert changes['removed'] == ['sport']
     65        assert changes['removed'] == ['email', 'sport']
    6666
    6767    def test_install_catalog(self):
    6868        root = OpenWorkouts()
     69        assert isinstance(getattr(root, 'catalog', None), Catalog)
     70        del root.catalog
    6971        assert getattr(root, 'catalog', None) is None
    7072        install_catalog(root)
     
    7880    def test_get_catalog_not_existing_catalog(self):
    7981        root = OpenWorkouts()
     82        assert isinstance(getattr(root, 'catalog', None), Catalog)
     83        del root.catalog
    8084        assert getattr(root, 'catalog', None) is None
    8185        catalog = get_catalog(root)
Note: See TracChangeset for help on using the changeset viewer.