Add initial tests for Web Interface.
This commit is contained in:
parent
fa3dda1c60
commit
050e641bb0
26
tests/WebApplicationTest.py
Normal file
26
tests/WebApplicationTest.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from webtest import TestApp
|
||||
import unittest
|
||||
from ticketfrei import frontend
|
||||
|
||||
class TestLogin(unittest.TestCase):
|
||||
|
||||
def test_login_not_registered(self):
|
||||
app = TestApp(frontend.application)
|
||||
request = app.post('/login', {'email': 'foo@abc.de', 'pass': 'bar'}, expect_errors=True)
|
||||
self.assertEqual(request.status_code, 401)
|
||||
|
||||
class TestRegister(unittest.TestCase):
|
||||
|
||||
def test_register(self):
|
||||
app = TestApp(frontend.application)
|
||||
request = app.post('/register', {'email': 'foo@abc.de', 'pass': 'bar', 'pass-repeat': 'bar', 'city': 'testcity'}, expect_errors=True)
|
||||
self.assertEqual(request.status_code, 201)
|
||||
|
||||
def test_getRoot(self):
|
||||
app = TestApp(frontend.application)
|
||||
request = app.get('/')
|
||||
self.assertEqual(request.status_code, 200)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
BIN
tests/db.sqlite
Normal file
BIN
tests/db.sqlite
Normal file
Binary file not shown.
77
tests/errors.log
Normal file
77
tests/errors.log
Normal file
|
@ -0,0 +1,77 @@
|
|||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
||||
Could not send confirmation mail to foo@abc.de
|
||||
Traceback (most recent call last):
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/frontend.py", line 42, in register_post
|
||||
link = url('confirm/' + city + '/%s' % db.user_token(email, password))
|
||||
File "/home/kaese/Projekte/ticketfrei/ticketfrei/db.py", line 186, in user_token
|
||||
return jwt.encode({
|
||||
AttributeError: module 'jwt' has no attribute 'encode'
|
Loading…
Reference in a new issue