Commit 9f15cc43 by Bruno Bzeznik

Factorized auth

parent cf5d4dff
# Webtests for phyloalps
from webtest import TestApp
app = TestApp('http://data.phylodev.org')
resp = app.get('/home/login/?next=/browse/project/PHA/sample/969/')
form = resp.form
form['username'] = 'admin'
form['password'] = 'phylodev'
resp = form.submit().follow()
def phyloget(url):
resp = app.get(url)
form = resp.form
form['username'] = 'admin'
form['password'] = 'phylodev'
return form.submit().follow()
# Sample test
resp = phyloget('/home/login/?next=/browse/project/PHA/sample/969/')
assert 'Asplenium lepidum' in resp
# Sample failing test
resp = phyloget('/home/login/?next=/browse/project/PHA/sample/969/')
assert 'Asplenium lepidumm' in resp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment