def test_users_can_login(self): response = self.client.post(url_for('login'), data={ 'email': User.email, 'password': User.password }) self.assertEqual(response.status_code, 302) self.assert_redirects(response, url_for('create_short')) db.session.remove() db.drop_all()
def reset(): if request.method == 'POST': r = request.json if 'password' in r.keys(): if r['password'] == 'fangopass': with app.app_context(): db.drop_all() db.create_all() db.session.commit() else: return pass_needed() else: return pass_needed() return {'result': 'all clear'}, 200
def load_dummy(): if request.method == 'POST': r = request.json if 'password' in r.keys(): if r['password'] == 'fangopass': with app.app_context(): db.drop_all() db.create_all() db.session.commit() # with app.app_context(): load_dummy_on_db() else: return pass_needed() else: return pass_needed() return {'result': 'dummy loaded'}, 200
def run(self, **kwargs): db.drop_all() db.create_all()
def teardown(): _db.drop_all() os.unlink(TESTDB_PATH)
def teardown(self): db.session.remove() db.drop_all()
def run(self, **kwargs): db.drop_all() db.create_all()