add javascript ajax example

This commit is contained in:
David Lord 2018-04-12 11:06:02 -07:00
parent d8bf589d48
commit fce1885f76
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
21 changed files with 341 additions and 13 deletions

View file

@ -65,12 +65,11 @@ Test
::
pip install pytest
pip install '.[test]'
pytest
Run with coverage report::
pip install pytest coverage
coverage run -m pytest
coverage report
coverage html # open htmlcov/index.html in a browser

View file

@ -56,7 +56,7 @@ def register():
elif db.execute(
'SELECT id FROM user WHERE username = ?', (username,)
).fetchone() is not None:
error = 'User {} is already registered.'.format(username)
error = 'User {0} is already registered.'.format(username)
if error is None:
# the name is available, store it in the database and go to

View file

@ -2,7 +2,7 @@
license_file = LICENSE
[bdist_wheel]
universal = False
universal = True
[tool:pytest]
testpaths = tests

View file

@ -20,4 +20,10 @@ setup(
install_requires=[
'flask',
],
extras_require={
'test': [
'pytest',
'coverage',
],
},
)