Changeset 42baca4 in OpenWorkouts-current for ow/tests/models/test_root.py


Ignore:
Timestamp:
Apr 22, 2019, 6:14:53 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current
Children:
0dedfbe
Parents:
e52a502
Message:

(#39) Do not allow duplicated workouts by default when uploading track files.
We still allow users to add duplicates if they want, by checking a checkbox
we show in the upload workout form when we find a possible duplicate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/tests/models/test_root.py

    re52a502 r42baca4  
    3535        # a new OpenWorkouts instance has a catalog created automatically
    3636        assert isinstance(root.catalog, Catalog)
    37         assert len(root.catalog) == 3
    38         for key in ['email', 'nickname', 'sport']:
     37        assert len(root.catalog) == 4
     38        for key in ['email', 'nickname', 'sport', 'hashed']:
    3939            assert key in root.catalog
    4040
    4141    def test_update_indexes(self, root):
    4242        indexes = sorted([i for i in root.catalog])
    43         assert indexes == ['email', 'nickname', 'sport']
     43        assert indexes == ['email', 'hashed', 'nickname', 'sport']
    4444        # remove one index
    4545        del root.catalog['email']
    4646        indexes = sorted([i for i in root.catalog])
    47         assert indexes == ['nickname', 'sport']
     47        assert indexes == ['hashed', 'nickname', 'sport']
    4848        # now update indexes, the index will be back there
    4949        root._update_indexes()
    5050        indexes = sorted([i for i in root.catalog])
    51         assert indexes == ['email', 'nickname', 'sport']
     51        assert indexes == ['email', 'hashed', 'nickname', 'sport']
    5252
    5353    def test_add_user_ok(self, root):
Note: See TracChangeset for help on using the changeset viewer.