# Path: apps/base/auth.py
# def confirmInvite(id):
# def invite2uid(id):
# def canReadFile(uid, id_source, req=None):
# def canDownloadFileComments(uid, id_source):
# def canDownloadPDF(uid, id_source):
# def canGuestReadFile(uid, id_source, req=None):
# def canGuestDownloadPDF(id_source):
# def getGuest(ckey=None):
# def getCkeyInfo(ckey):
# def canAnnotate(uid, eid):
# def canImportAnnotation(uid, from_id_source, to_id_source):
# def canAdministrateLocation(uid, id_location):
# def addUser(email, password, conf, valid=0, guest=0):
# def addInvite(key, id_user, id_ensemble, id_section, admin):
# def createGuest():
# def getGuestCkey():
# def user_from_email(email):
# def checkUser(email, password):
# def canAddFolder(uid, id_ensemble, id_parent=None):
# def canInsertFile(uid, eid, id_folder=None):
# def canRenameFile(uid, id):
# def canRenameFolder(uid, id):
# def canEditAssignment(uid, id):
# def canDeleteFile(uid, id):
# def canDeleteFolder(uid, id):
# def canMoveFile(uid, id, id_dest=None):
# def __isDirOrParent(id_a, id_b):
# def canMoveFolder(uid, id, id_dest):
# def canUpdateFile(uid, id):
# def canSendInvite(uid, eid):
# def canEditEnsemble(uid, eid):
# def canSeeGrades(uid, eid):
# def canGetSectionsInfo(uid, eid):
# def canGetMembers(uid, eid):
# def canGrade(uid, id_source, id_student):
# def isMember(user_id, ensemble_id):
# def canEdit(uid, id_ann):
# def canDelete(uid, id_ann):
# def canDeleteThread(uid, id_location):
# def canLabelComment(uid, cid):
# def canPauseComment(uid, id_source):
# def canMarkThread(uid, id_location):
# def log_guest_login(ckey, id_user):


from django.test import TestCase
from apps.base import auth
test_auth.py

Note that Django 1.3 uses Python 2.7 unittest syntax, even when running in Python 2.6

Author 
    Peter Wilkins <pwilkins@mit.edu>
    Sacha Zyto <sacha@csail.mit.edu>
    
License
    Copyright (c) 2011 Massachusetts Institute of Technology.
    MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php)
    
$ Id: $    
"""

class TestConfirmInvite(TestCase):
    fixtures = ['Membership', 'Invite', ]

    def test_confirm_invite(self):
        # self.assertEqual(expected, confirmInvite(id))
#        assert False # TODO: implement your test here
        self.assertEqual(auth.confirmInvite('617-555-1212'), None)
        
        invite = auth.confirmInvite('hQFyCu91Z1Lj1tdarrG3eUkbLcHuktnM4FurHiXV7m7wdOwJPf')
        self.assertEqual(invite.id, 3214) 

class TestInvite2uid(TestCase):
    fixtures = ['Invite', 'User', ]
    
    def test_invite2uid(self):

# Path: apps/base/auth.py
# def confirmInvite(id):
# def invite2uid(id):
# def canReadFile(uid, id_source, req=None):
# def canDownloadFileComments(uid, id_source):
# def canDownloadPDF(uid, id_source):
# def canGuestReadFile(uid, id_source, req=None):
# def canGuestDownloadPDF(id_source):
# def getGuest(ckey=None):
# def getCkeyInfo(ckey):
# def canAnnotate(uid, eid):
# def canImportAnnotation(uid, from_id_source, to_id_source):
# def canAdministrateLocation(uid, id_location):
# def addUser(email, password, conf, valid=0, guest=0):
# def addInvite(key, id_user, id_ensemble, id_section, admin):
# def createGuest():
# def getGuestCkey():
# def user_from_email(email):
# def checkUser(email, password):
# def canAddFolder(uid, id_ensemble, id_parent=None):
# def canInsertFile(uid, eid, id_folder=None):
# def canRenameFile(uid, id):
# def canRenameFolder(uid, id):
# def canEditAssignment(uid, id):
# def canDeleteFile(uid, id):
# def canDeleteFolder(uid, id):
# def canMoveFile(uid, id, id_dest=None):
# def __isDirOrParent(id_a, id_b):
# def canMoveFolder(uid, id, id_dest):
# def canUpdateFile(uid, id):
# def canSendInvite(uid, eid):
# def canEditEnsemble(uid, eid):
# def canSeeGrades(uid, eid):
# def canGetSectionsInfo(uid, eid):
# def canGetMembers(uid, eid):
# def canGrade(uid, id_source, id_student):
# def isMember(user_id, ensemble_id):
# def canEdit(uid, id_ann):
# def canDelete(uid, id_ann):
# def canDeleteThread(uid, id_location):
# def canLabelComment(uid, cid):
# def canPauseComment(uid, id_source):
# def canMarkThread(uid, id_location):
# def log_guest_login(ckey, id_user):


# Path: apps/base/tests/test_auth.py
from django.test import TestCase
from apps.base import auth

test_auth.py

Note that Django 1.3 uses Python 2.7 unittest syntax, even when running in Python 2.6

Author 
    Peter Wilkins <pwilkins@mit.edu>
    Sacha Zyto <sacha@csail.mit.edu>
    
License
    Copyright (c) 2011 Massachusetts Institute of Technology.
    MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php)
    
$ Id: $    
"""

class TestConfirmInvite(TestCase):
    fixtures = ['Membership', 'Invite', ]

    def test_confirm_invite(self):
        # self.assertEqual(expected, confirmInvite(id))
#        assert False # TODO: implement your test here
        self.assertEqual(auth.confirmInvite('617-555-1212'), None)
        
        invite = auth.confirmInvite('hQFyCu91Z1Lj1tdarrG3eUkbLcHuktnM4FurHiXV7m7wdOwJPf')
        self.assertEqual(invite.id, 3214) 

class TestInvite2uid(TestCase):
    fixtures = ['Invite', 'User', ]
    
    def test_invite2uid(self):

        self.assertEqual(None, auth.invite2uid(None), 'invite2uid() != None')