Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update login/logout tests to be more particular... #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def setUp(self):
db.app = app
db.init_app(app)
db.create_all()
seed_db()

def tearDown(self):
"""
Expand Down Expand Up @@ -76,9 +77,10 @@ def test_login_logout(self):
db.session.commit()

rv = self.login('jsmith', 'test')
self.assertTrue('Logout' in rv.data)
self.assertTrue('Logout</a>' in rv.data)

rv = self.logout()
self.assertTrue('Login' in rv.data)
self.assertTrue('Log In</a>' in rv.data)

rv = self.login('jsmith', 'testb')
self.assertTrue('User name and password do not match' in rv.data)
Expand All @@ -90,7 +92,6 @@ def test_login_logout(self):
# Test Beer Edit Views
# ==============================================================================
def test_est_color(self):
seed_db()
color_json = {u'units': u'gallons', u'extracts': [{u'name': u'extract', u'value': u'Ultralight Extract (MoreBeer)'}, {u'name': u'extract_amount', u'value': u'144.0'}, {u'name': u'extract-units', u'value': u'ounces'}, {u'name': u'extract', u'value': u'Dry Light Extract'}, {u'name': u'extract_amount', u'value': u'8.0'}, {u'name': u'extract-units', u'value': u'ounces'}], u'grains': [{u'name': u'grain', u'value': u'Crystal 15'}, {u'name': u'grain_amount', u'value': u'12.0'}, {u'name': u'grain_units', u'value': u'ounces'}], u'batch_size': u'5.28'}

rv = self.app.post('/colorcalc', data=json.dumps(color_json), content_type='application/json')
Expand Down