Ejemplo n.º 1
0
 def test_create_with_username_starting_with_numeric(self):
     """Successfully create a user with name starting with numeric chars"""
     testuser = UserTracker(
         name=u'1234user', givenname=u'First1234', sn=u'Surname1234',
     )
     testuser.create()
     testuser.delete()
Ejemplo n.º 2
0
 def test_create_with_username_starting_with_numeric(self):
     """Successfully create a user with name starting with numeric chars"""
     testuser = UserTracker(
         name=u'1234user', givenname=u'First1234', sn=u'Surname1234',
     )
     testuser.create()
     testuser.delete()
Ejemplo n.º 3
0
 def test_create_with_uppercase_principal(self):
     """ Create user with upper-case principal """
     testuser = UserTracker(name=u'tuser1',
                            givenname=u'Test',
                            sn=u'Tuser1',
                            krbprincipalname=u'tuser1'.upper())
     testuser.create()
     testuser.delete()
Ejemplo n.º 4
0
 def test_create_with_uppercase_principal(self):
     """ Create user with upper-case principal """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
         krbprincipalname=u'tuser1'.upper()
     )
     testuser.create()
     testuser.delete()
Ejemplo n.º 5
0
 def test_create_with_full_address(self):
     """ Create user with full address set """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
         street=u'123 Maple Rd', l=u'Anytown', st=u'MD',
         postalcode=u'01234-5678', mobile=u'410-555-1212'
     )
     testuser.create()
     testuser.delete()
Ejemplo n.º 6
0
 def test_create_with_full_address(self):
     """ Create user with full address set """
     testuser = UserTracker(
         name=u'tuser1', givenname=u'Test', sn=u'Tuser1',
         street=u'123 Maple Rd', l=u'Anytown', st=u'MD',
         postalcode=u'01234-5678', mobile=u'410-555-1212'
     )
     testuser.create()
     testuser.delete()
Ejemplo n.º 7
0
    def test_add_user_coliding_with_alias(self, krbalias_user):
        krbalias_user.ensure_exists()

        user_alias = u'conflicting_name'
        krbalias_user.add_principal([user_alias])

        conflict_user = UserTracker(user_alias, u'test', u'conflict')

        with pytest.raises(errors.DuplicateEntry):
            conflict_user.create()
    def test_add_user_coliding_with_alias(self, krbalias_user):
        krbalias_user.ensure_exists()

        user_alias = u'conflicting_name'
        krbalias_user.add_principal([user_alias])

        conflict_user = UserTracker(user_alias, u'test', u'conflict')

        with pytest.raises(errors.DuplicateEntry):
            conflict_user.create()
Ejemplo n.º 9
0
 def test_create_with_numeric_only_username(self):
     """Try to create a user with name only contains numeric chars"""
     testuser = UserTracker(
         name=u'1234', givenname=u'NumFirst1234', sn=u'NumSurname1234',
     )
     with raises_exact(errors.ValidationError(
             name=u'login',
             error=u'may only include letters, numbers, _, -, . and $',
     )):
         testuser.create()
Ejemplo n.º 10
0
 def test_create_with_numeric_only_username(self):
     """Try to create a user with name only contains numeric chars"""
     testuser = UserTracker(
         name=u'1234', givenname=u'NumFirst1234', sn=u'NumSurname1234',
     )
     with raises_exact(errors.ValidationError(
             name=u'login',
             error=u'may only include letters, numbers, _, -, . and $',
     )):
         testuser.create()