Exemplo n.º 1
0
    def test_create_talk(self):
        with self.app.test_request_context():
            login_user_url = url_for_security('login')
            talk_submit_url = url_for('general.talk_submit')

        with self.app.test_client() as client:
            values = dict(
                email='*****@*****.**',
                password='******',
            )

            response = client.post(login_user_url,
                                   data=values,
                                   follow_redirects=True)
            self.assertEqual(response.status_code, 200)

            self.assertTrue(current_user.is_authenticated())

            values = dict(
                title='Evy - Distributed CI',
                description='Description',
                twitter='@evy',
                site_url='http://evy.com',
                level='beginner',
            )
            response = client.post(talk_submit_url,
                                   data=values,
                                   follow_redirects=True)

            self.assertEqual(response.status_code, 200)
Exemplo n.º 2
0
 def is_accessible(self):
     return current_user.is_authenticated()
Exemplo n.º 3
0
def home():
    if current_user.is_authenticated():
        return redirect(url_for('dashboard'))
    else:
        form = LoginForm()
        return render_template('index.html', form=form)