Changes in ow/tests/models/test_workout.py [c9991fed:78af3d1] in OpenWorkouts-current
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/tests/models/test_workout.py
rc9991fed r78af3d1 6 6 7 7 import pytest 8 from pyramid.security import Allow, Everyone 8 from pyramid.security import Allow, Everyone, Deny, ALL_PERMISSIONS 9 9 10 10 from ow.models.workout import Workout … … 33 33 def test__acl__(self, root): 34 34 # First check permissions for a workout without parent 35 permissions = [(Allow, Everyone, 'view'), 36 (Allow, 'group:admins', 'edit')] 37 workout = Workout() 38 assert workout.__acl__() == permissions 39 35 workout = Workout() 36 with pytest.raises(AttributeError): 37 workout.__acl__() 40 38 # Now permissions on a workout that has been added to a user 41 39 uid = str(root['john'].uid) 42 permissions = [(Allow, uid, 'view'), (Allow, uid, 'edit')] 43 assert root['john']['1'].__acl__() == permissions 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 44 48 45 49 def test_runthrough(self, root):
Note: See TracChangeset
for help on using the changeset viewer.