def test_admin_dashboard_attempt(self):
     with app.test_request_context():
         logout(self.app)
         register(self.app, "*****@*****.**", "SomeRandomPassword")
         login(self.app, "*****@*****.**", "SomeRandomPassword")
         rv = self.app.get(url_for('sadmin.index_view'), follow_redirects=True)
         self.assertEqual(rv.status_code, 403)
 def setUp(self):
     self.app = Setup.create_app()
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
         logout(self.app)
         event_id = create_event(
             name='TestEvent_1', creator_email=u'*****@*****.**')
         create_services(event_id)
 def test_admin_dashboard_attempt(self):
     with app.test_request_context():
         logout(self.app)
         register(self.app, "*****@*****.**", "SomeRandomPassword")
         login(self.app, "*****@*****.**", "SomeRandomPassword")
         rv = self.app.get(url_for('sadmin.index_view'),
                           follow_redirects=True)
         self.assertEqual(rv.status_code, 403)
Beispiel #4
0
 def test_user_already_logged_in(self):
     """If the user is already logged in then on clicking 'Login with Google' he should be redirected
         directly to the admin page"""
     with app.test_request_context():
         register(self.app, '*****@*****.**', 'test')
         logout(self.app)
         login(self.app, '*****@*****.**', 'test')
         self.assertTrue('Open Event' in self.app.get('/gCallback/?state=dummy_state&code=dummy_code',
                                                        follow_redirects=True).data)
         self.assertEqual(self.app.get('/gCallback/?state=dummy_state&code=dummy_code').status_code, 302)
    def test_track_at_session_form(self):
        register(self.app, 'test_user', '*****@*****.**', 'test_pwd')
        # User is registered and logged in

        with app.test_request_context():
            self._create_track()
            response = self.app.get('/admin/event/1/session/new',
                              follow_redirects=True)
            self.assertIn('SomeTrack', response.data)
            self._delete_track()

        logout(self.app)
 def setUp(self):
     self.app = Setup.create_app()
     with app.test_request_context():
         register(self.app, '*****@*****.**', 'test')
         logout(self.app)
         update_role_to_admin({'admin_perm': 'isAdmin'}, user_id=1)
 def test_logout(self):
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
     login(self.app, '*****@*****.**', 'test')
     rv = logout(self.app)
     self.assertTrue("Login" in rv.data)
 def test_login(self):
     register(self.app, "test", "*****@*****.**", "test")
     logout(self.app)
     rv = login(self.app, "test", "test")
     self.assertTrue("The FOSSASIA Open Event" in rv.data)
Beispiel #9
0
 def test_login(self):
     register(self.app,'test', '*****@*****.**', 'test')
     logout(self.app)
     rv = login(self.app, 'test', 'test')
     self.assertTrue("The FOSSASIA Open Event" in rv.data)
Beispiel #10
0
 def test_logout(self):
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
     login(self.app, '*****@*****.**', 'test')
     rv = logout(self.app)
     self.assertTrue("Login" in rv.data)
 def test_logout(self):
     login(self.app, 'test', 'test')
     rv = logout(self.app)
     self.assertTrue("Login" in rv.data)
 def test_incorrect_login(self):
     register(self.app, 'test', '*****@*****.**', 'test')
     logout(self.app)
     rv = login(self.app, 'other_test', 'other_test')
     self.assertTrue("Login Form" in rv.data)
 def test_correct_login(self):
     register(self.app, 'test', '*****@*****.**', 'test')
     logout(self.app)
     rv = login(self.app, 'test', 'test')
     self.assertTrue("Create New Event" in rv.data)
Beispiel #14
0
 def test_logout(self):
     login(self.app, '*****@*****.**', 'test')
     rv = logout(self.app)
     self.assertTrue("Login" in rv.data)
Beispiel #15
0
 def test_correct_login(self):
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
         logout(self.app)
         rv = login(self.app, '*****@*****.**', 'test')
         self.assertTrue("Open Event" in rv.data, msg=rv.data)
Beispiel #16
0
 def test_incorrect_login(self):
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
         logout(self.app)
         rv = login(self.app, '*****@*****.**', 'other_test')
         self.assertTrue("Login Form" in rv.data)
 def setUp(self):
     self.app = Setup.create_app()
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
         logout(self.app)
         create_event(creator_email=u'*****@*****.**')
Beispiel #18
0
 def test_logout(self):
     register(self.app,'test', '*****@*****.**', 'test')
     rv = logout(self.app)
     self.assertTrue("Don't have an account?" in rv.data)
 def test_correct_login(self):
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
         logout(self.app)
         rv = login(self.app, '*****@*****.**', 'test')
         self.assertTrue("Open Event" in rv.data, msg=rv.data)
 def test_incorrect_login(self):
     with app.test_request_context():
         register(self.app, u'*****@*****.**', u'test')
         logout(self.app)
         rv = login(self.app, '*****@*****.**', 'other_test')
         self.assertTrue("Login Form" in rv.data)
 def test_logout(self):
     register(self.app, "test", "*****@*****.**", "test")
     rv = logout(self.app)
     self.assertTrue("Don't have an account?" in rv.data)