Ejemplo n.º 1
0
 def test_wrong_password(self):
     self.add_dummy_user()
     from crmbase.views.auth import login_view
     self.config.add_route('index', '/')
     request = self.get_csrf_request(
                     dict(submit=True,
                           login='******',
                           password='******',
                           ))
     response = login_view(request)
     assert request.session.pop_flash('error')
Ejemplo n.º 2
0
 def test_login(self):
     self.add_dummy_user()
     from crmbase.views.auth import login_view
     self.config.add_route('index', '/')
     request = self.get_csrf_request(
                     dict(submit=True,
                           login='******',
                           password='******',
                           ))
     response = login_view(request)
     assert response.status_int == 302
Ejemplo n.º 3
0
 def test_redirect(self):
     self.add_dummy_user()
     from crmbase.views.auth import login_view
     self.config.add_route('index', '/')
     request = self.get_csrf_request(
                     dict(submit=True,
                           login='******',
                           password='******',
                           nextpage='/dummy'
                           ))
     response = login_view(request)
     assert response.status_int == 302
     assert '/dummy' in dict(response.headerlist).values()