def test_level_up_to_two(self): renown = club_level_up_need_renown(1) + 1 club = Club(1, 1) club.update(renown=renown) doc = MongoDB.get(1).character.find_one({'_id': 1}, {'club': 1}) assert doc['club']['level'] == 2 assert club.level == 2
def test_add_gold(self): gold = 99 club = Club(1, 1) club.update(gold=gold) doc = MongoDB.get(1).character.find_one({'_id': 1}, {'club': 1}) assert doc['club']['gold'] == gold assert club.gold == gold
def test_level_up_to_five(self): renown = 0 for i in range(1, 5): renown += club_level_up_need_renown(i) renown += 1 club = Club(1, 1) club.update(renown=renown) doc = MongoDB.get(1).character.find_one({'_id': 1}, {'club': 1}) assert doc['club']['level'] == 5 assert club.level == 5