Changes in ow/tests/models/test_workout.py [78af3d1:c9991fed] in OpenWorkouts-current


Ignore:
File:
1 edited

Legend:

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

    r78af3d1 rc9991fed  
    66
    77import pytest
    8 from pyramid.security import Allow, Everyone, Deny, ALL_PERMISSIONS
     8from pyramid.security import Allow, Everyone
    99
    1010from ow.models.workout import Workout
     
    3333    def test__acl__(self, root):
    3434        # First check permissions for a workout without parent
    35         workout = Workout()
    36         with pytest.raises(AttributeError):
    37             workout.__acl__()
     35        permissions = [(Allow, Everyone, 'view'),
     36                       (Allow, 'group:admins', 'edit')]
     37        workout = Workout()
     38        assert workout.__acl__() == permissions
     39
    3840        # Now permissions on a workout that has been added to a user
    3941        uid = str(root['john'].uid)
    40         workout = root['john']['1']
    41         permissions = [
    42             (Allow, uid, 'view'),
    43             (Allow, uid, 'edit'),
    44             (Allow, uid, 'delete'),
    45             (Deny, Everyone, ALL_PERMISSIONS)
    46         ]
    47         assert workout.__acl__() == permissions
     42        permissions = [(Allow, uid, 'view'), (Allow, uid, 'edit')]
     43        assert root['john']['1'].__acl__() == permissions
    4844
    4945    def test_runthrough(self, root):
Note: See TracChangeset for help on using the changeset viewer.