forked from ticketfrei/ticketfrei
Fix reverse assertion in Tests.
This commit is contained in:
parent
5c844157ce
commit
e4d0fc3b89
|
@ -1,25 +1,25 @@
|
||||||
from webtest import TestApp
|
from webtest import TestApp
|
||||||
import unittest
|
import unittest
|
||||||
from ticketfrei import frontend
|
import frontend
|
||||||
|
|
||||||
class TestLogin(unittest.TestCase):
|
class TestLogin(unittest.TestCase):
|
||||||
|
|
||||||
def test_login_not_registered(self):
|
def test_login_not_registered(self):
|
||||||
app = TestApp(frontend.application)
|
app = TestApp(frontend.application)
|
||||||
request = app.post('/login', {'email': 'foo@abc.de', 'pass': 'bar'}, expect_errors=True)
|
request = app.post('/login', {'email': '', 'pass': ''}, expect_errors=True)
|
||||||
self.assertEqual(request.status_code, 401)
|
self.assertEqual(401, request.status_code)
|
||||||
|
|
||||||
class TestRegister(unittest.TestCase):
|
class TestRegister(unittest.TestCase):
|
||||||
|
|
||||||
def test_register(self):
|
def test_register(self):
|
||||||
app = TestApp(frontend.application)
|
app = TestApp(frontend.application)
|
||||||
request = app.post('/register', {'email': 'foo@abc.de', 'pass': 'bar', 'pass-repeat': 'bar', 'city': 'testcity'}, expect_errors=True)
|
request = app.post('/register', {'email': 'foo@abc.de', 'pass': 'bar', 'pass-repeat': 'bar', 'city': 'testcity'}, expect_errors=True)
|
||||||
self.assertEqual(request.status_code, 201)
|
self.assertEqual(200, request.status_code)
|
||||||
|
|
||||||
def test_getRoot(self):
|
def test_getRoot(self):
|
||||||
app = TestApp(frontend.application)
|
app = TestApp(frontend.application)
|
||||||
request = app.get('/')
|
request = app.get('/')
|
||||||
self.assertEqual(request.status_code, 200)
|
self.assertEqual(200, request.status_code)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
Loading…
Reference in a new issue