Example #1
0
 def test_create_invalid_uid(self):
     invalid = StageUserTracker(invaliduser1, u'invalid', u'user')
     command = invalid.make_create_command()
     with raises_exact(errors.ValidationError(
         name='login',
             error=u"may only include letters, numbers, _, -, . and $")):
         command()
Example #2
0
 def test_create_long_uid(self):
     invalid = StageUserTracker(invaliduser2, u'invalid', u'user')
     command = invalid.make_create_command()
     with raises_exact(errors.ValidationError(
             name='login',
             error=u"can be at most 32 characters")):
         command()
Example #3
0
 def test_create_invalid_uid(self):
     invalid = StageUserTracker(invaliduser1, u'invalid', u'user')
     command = invalid.make_create_command()
     with raises_exact(errors.ValidationError(
         name='login',
             error=u"may only include letters, numbers, _, -, . and $")):
         command()
Example #4
0
 def test_create_long_uid(self):
     invalid = StageUserTracker(invaliduser2, u'invalid', u'user')
     command = invalid.make_create_command()
     with raises_exact(
             errors.ValidationError(name='login',
                                    error=u"can be at most 32 characters")):
         command()
Example #5
0
def stageduser_customattr(request):
    tracker = StageUserTracker(u'customattr', u'customattr', u'customattr',
                               setattr=u'businesscategory=BusinessCat')
    tracker.track_create()
    tracker.attrs.update(
        businesscategory=[u'BusinessCat']
    )
    return tracker.make_fixture(request)
Example #6
0
def stageduser4(request):
    tracker = StageUserTracker(u'tuser', u'test', u'user')
    return tracker.make_fixture(request)
Example #7
0
def stageduser3(request):
    tracker = StageUserTracker(name=u'suser3', givenname=u'staged', sn=u'user')
    return tracker.make_fixture_activate(request)
Example #8
0
def stageduser2(request):
    tracker = StageUserTracker(u'suser2', u'staged', u'user', **request.param)
    return tracker.make_fixture_activate(request)
Example #9
0
def stageduser_min(request):
    tracker = StageUserTracker(givenname=u'stagedmin', sn=u'usermin')
    return tracker.make_fixture(request)
Example #10
0
def stageduser2(request):
    tracker = StageUserTracker(u'suser2', u'staged', u'user', **request.param)
    return tracker.make_fixture_activate(request)
Example #11
0
def stageduser(request):
    tracker = StageUserTracker(name=u'suser1', givenname=u'staged', sn=u'user')
    return tracker.make_fixture(request)
Example #12
0
    def test_staged_from_preserved(self, user7, stageduser):
        user7.make_preserved_user()

        stageduser.ensure_missing()
        stageduser = StageUserTracker(user7.uid, user7.givenname, user7.sn)
        stageduser.create_from_preserved(user7)
        command = user7.make_stage_command()
        result = command()
        stageduser.check_restore_preserved(result)
        stageduser.exists = True

        command = user7.make_retrieve_command()
        with raises_exact(errors.NotFound(
                reason=u'%s: user not found' % stageduser.uid)):
            command()

        command = stageduser.make_retrieve_command()
        result = command()
        stageduser.check_retrieve(result)

        stageduser.delete()
Example #13
0
def staged_user(request, xmlrpc_setup):
    name = u'st-user'
    tracker = StageUserTracker(name, u'stage', u'test')

    return tracker.make_fixture(request)
Example #14
0
def stageduser4(request):
    tracker = StageUserTracker(u'tuser', u'test', u'user')
    return tracker.make_fixture(request)
Example #15
0
def stageduser_notposix(request):
    tracker = StageUserTracker(u'notposix', u'notposix', u'notposix')
    return tracker.make_fixture(request)
Example #16
0
def stageduser_min(request):
    tracker = StageUserTracker(givenname=u'stagedmin', sn=u'usermin')
    return tracker.make_fixture(request)
Example #17
0
def staged_user(request):
    name = u'st-user'
    tracker = StageUserTracker(name, u'stage', u'test')

    return tracker.make_fixture(request)
Example #18
0
    def test_staged_from_preserved(self, user7, stageduser):
        user7.make_preserved_user()

        stageduser.ensure_missing()
        stageduser = StageUserTracker(user7.uid, user7.givenname, user7.sn)
        stageduser.create_from_preserved(user7)
        command = user7.make_stage_command()
        result = command()
        stageduser.check_restore_preserved(result)
        stageduser.exists = True

        command = user7.make_retrieve_command()
        with raises_exact(
                errors.NotFound(reason=u'%s: user not found' %
                                stageduser.uid)):
            command()

        command = stageduser.make_retrieve_command()
        result = command()
        stageduser.check_retrieve(result)

        stageduser.delete()
Example #19
0
def stageduser(request, xmlrpc_setup):
    tracker = StageUserTracker(name=u'suser1', givenname=u'staged', sn=u'user')
    return tracker.make_fixture(request)