Ejemplo n.º 1
0
 def test_login_redirect_url(self):
     user = CustomUser(username='******', icq=123134,skype='customuser')
     user.set_password('customuser')
     user.save()
     settings.LOGIN_REDIRECT_URL = '/views/form/context/'
     test = ViewHelper(self, reverse('login'), {'username':'******','password':'******'})
     test.redirect('/views/form/context/')
Ejemplo n.º 2
0
 def test_baseuser(self):
     """Проверяем создание пользователя"""
     user = CustomUser(username='******', icq=123134,skype='customuser')
     user.set_password('customuser')
     user.save()
     self.assertEqual('customuser', CustomUser.objects.get(username='******').username)
     self.assertEqual('customuser', User.objects.get(username='******').username)
Ejemplo n.º 3
0
 def test_baseuser_in_context(self):
     """Проверяем доступ к юзеру из реквеста"""
     user = CustomUser(username='******', icq=123134,skype='customuser', is_active=True)
     user.set_password('customuser')
     user.save()
     self.client.login(username='******', password='******')
     test = ViewHelper(self, reverse('baseuser_check'), method='get')
     customuser = test.context('customuser')
     self.assertTrue(isinstance(customuser, CustomUser))
Ejemplo n.º 4
0
 def test_login(self):
     user = CustomUser(username='******', icq=123134,skype='customuser')
     user.set_password('customuser')
     user.save()
     test = ViewHelper(self, reverse('login'), {'username':'******','password':'******','next':'/'})
     test.redirect('/')
Ejemplo n.º 5
0
 def _create_user(self, name):
     user = CustomUser(username=name, icq=123134, skype='customuser', is_active=True)
     user.set_password(name)
     user.save()