From 11bd30e01f33c68bf24c09ce9a5ae8675f4d7494 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 23 Jul 2018 12:58:12 +0200 Subject: [PATCH] [Bugfix] Fix broken tests --- tests/test_calsocial.py | 2 +- tests/test_login.py | 10 +--------- tests/test_register.py | 15 +++++++-------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/tests/test_calsocial.py b/tests/test_calsocial.py index c6d9ddd..ef8bd5f 100644 --- a/tests/test_calsocial.py +++ b/tests/test_calsocial.py @@ -25,4 +25,4 @@ def test_index_no_login(client): """ page = client.get('/') - assert b'Welcome to Calendar.social' in page.data + assert b'Peek inside' in page.data diff --git a/tests/test_login.py b/tests/test_login.py index 543e072..6ccab42 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -23,14 +23,6 @@ from calsocial.models import db, User from helpers import client, login -def test_index_no_login(client): - """Test the main page without logging in - """ - - page = client.get('/') - assert b'Welcome to Calendar.social' in page.data - - def test_login_invalid_user(client): """Test logging in with a non-existing user """ @@ -81,4 +73,4 @@ def test_login_first_steps(client): assert page.location == 'http://localhost/' page = client.get('/') - assert page.location == 'http://localhost/first-steps' + assert page.location == 'http://localhost/accounts/first-steps' diff --git a/tests/test_register.py b/tests/test_register.py index 1bf81c2..2d10bdc 100644 --- a/tests/test_register.py +++ b/tests/test_register.py @@ -27,21 +27,21 @@ def test_register_page(client): """Test the registration page """ - page = client.get('/register') + page = client.get('/accounts/register') assert b'Register' in page.data def test_register_post_empty(client): """Test sending empty registration data """ - page = client.post('/register', data={}) + page = client.post('/accounts/register', data={}) assert b'This field is required' in page.data def test_register_invalid_email(client): """Test sending an invalid email address """ - page = client.post('/register', data={ + page = client.post('/accounts/register', data={ 'username': 'test', 'email': 'test', 'password': 'password', @@ -53,7 +53,7 @@ def test_register_password_mismatch(client): """Test sending different password for registration """ - page = client.post('/register', data={ + page = client.post('/accounts/register', data={ 'username': 'test', 'email': 'test@example.com', 'password': 'password', @@ -65,13 +65,12 @@ def test_register(client): """Test user registration """ - page = client.post('/register', data={ + page = client.post('/accounts/register', data={ 'username': 'test', 'email': 'test@example.com', 'password': 'password', 'password_retype': 'password', }) - print(page.data) assert page.status_code == 302 assert page.location == 'http://localhost/' @@ -90,7 +89,7 @@ def test_register_existing_username(client): db.session.add(user) db.session.commit() - page = client.post('/register', data={ + page = client.post('/accounts/register', data={ 'username': 'test', 'email': 'test2@example.com', 'password': 'password', @@ -107,7 +106,7 @@ def test_register_existing_email(client): db.session.add(user) db.session.commit() - page = client.post('/register', data={ + page = client.post('/accounts/register', data={ 'username': 'tester', 'email': 'test@example.com', 'password': 'password',