Commit 5d620931 by Joe Blaylock

Merge pull request #95 from Stanford-Online/jbau/rc/fix-anon-access-tests-for-real

Jbau/rc/fix anon access tests for real
parents 58089fb0 49d41b46
......@@ -333,9 +333,7 @@ def _has_access_descriptor(user, action, descriptor, course_key=None):
# after start date, all registered users can see it
# nonregistered users shouldn't be able to access certain descriptor types
debug("Allow: now > effective start date")
# JRBL Edited this to make the unit tests pass
#return UserProfile.has_registered(user) or _can_load_descriptor_nonregistered(descriptor)
return True
return UserProfile.has_registered(user) or _can_load_descriptor_nonregistered(descriptor)
# otherwise, need staff access
return _has_staff_access_to_descriptor(user, descriptor, course_key)
......
......@@ -102,6 +102,7 @@ class AccessTestCase(TestCase):
"""
mock_unit = Mock()
mock_unit._class_tags = {} # Needed for detached check in _has_access_descriptor
mock_unit.category = "problem"
def verify_access(student_should_have_access):
""" Verify the expected result from _has_access_descriptor """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment