def score_up(self): api = HabiticaApi(self.owner.habitica.user_id, self.owner.habitica.api_token) result = api.post_task(self.habit_id) self.tasks_completed += 1 self.last_upscored = timezone.now() self.save() return result
def score_up(self): api = HabiticaApi(self.owner.habitica.user_id, self.owner.habitica.api_token) self.tasks_completed += 1 self.last_upscored = timezone.now() self.save() return api.post_task(self.habit)
def test_post_task(mock_habitica_api): api = HabiticaApi(user_id=-1, api_token='uses_mok') response = api.post_task(task_id='test_id') assert default.JSON_DELTA in response