Test the new RESTful course index and outline views.

This commit is contained in:
Don Mitchell
2013-10-16 13:45:48 -04:00
parent 095a4e3d93
commit d45beaebfa
2 changed files with 61 additions and 0 deletions

View File

@@ -61,3 +61,21 @@ class CourseTestCase(ModuleStoreTestCase):
number='999',
display_name='Robot Super Course',
)
def createNonStaffAuthedUserClient(self):
"""
Create a non-staff user, log them in, and return the client to use for testing.
"""
uname = 'teststudent'
password = 'foo'
nonstaff = User.objects.create_user(uname, 'test+student@edx.org', password)
# Note that we do not actually need to do anything
# for registration if we directly mark them active.
nonstaff.is_active = True
nonstaff.is_staff = False
nonstaff.save()
client = Client()
client.login(username=uname, password=password)
return client