forked from gergely/calendar-social
[Bugfix] Fix broken tests
This commit is contained in:
@@ -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</button>' 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',
|
||||
|
Reference in New Issue
Block a user