Fixing scoring logic (#320)

* fix inconsistent scoring: take awards into account in user.place() (#319)
* Adding tests
This commit is contained in:
Kevin Chung
2017-07-17 22:18:23 -04:00
committed by GitHub
parent b900d1cb68
commit d84cd305f8
3 changed files with 138 additions and 6 deletions

View File

@@ -56,6 +56,12 @@ def login_as_user(app, name="user", password="password"):
return client
def get_scores(user):
scores = user.get('/scores')
scores = json.loads(scores.get_data(as_text=True))
return scores['standings']
def gen_challenge(db, name='chal_name', description='chal_description', value=100, category='chal_category', type=0):
chal = Challenges(name, description, value, category)
db.session.add(chal)