示例#1
0
 def test_transform_username(self):
     givenauth_obj = GivenAuth()
     givenauth_obj.strip_maildomain = True
     givenauth_obj.strip_windomain = True
     givenauth_obj.titlecase = True
     givenauth_obj.remove_blanks = True
     result = givenauth_obj.transform_username(u'testDomain\\test [email protected]')
     assert result == 'TestName'
示例#2
0
 def test_transform_username(self):
     givenauth_obj = GivenAuth()
     givenauth_obj.strip_maildomain = True
     givenauth_obj.strip_windomain = True
     givenauth_obj.titlecase = True
     givenauth_obj.remove_blanks = True
     result = givenauth_obj.transform_username(
         u'testDomain\\test [email protected]')
     assert result == 'TestName'
示例#3
0
 def test_request(self):
     givenauth_obj = GivenAuth()
     flaskg.user.auth_method = 'given'
     givenauth_obj.user_name = u'testDomain\\[email protected]'
     givenauth_obj.strip_maildomain = True
     givenauth_obj.strip_windomain = True
     givenauth_obj.titlecase = True
     givenauth_obj.remove_blanks = True
     create_user(u'Test_User', u'test_pass', u'*****@*****.**')
     test_user, bool_value = givenauth_obj.request(flaskg.user)
     assert test_user.valid
     assert test_user.name == [u'Test_User', ]
示例#4
0
 def test_request(self):
     givenauth_obj = GivenAuth()
     flaskg.user.auth_method = 'given'
     givenauth_obj.user_name = u'testDomain\\[email protected]'
     givenauth_obj.strip_maildomain = True
     givenauth_obj.strip_windomain = True
     givenauth_obj.titlecase = True
     givenauth_obj.remove_blanks = True
     create_user(u'Test_User', u'test_pass', u'*****@*****.**')
     test_user, bool_value = givenauth_obj.request(flaskg.user)
     assert test_user.valid
     assert test_user.name == [
         u'Test_User',
     ]