def test_activate_ability_unlogined(self): self.check_ajax_error( self.client.post(use_ability_url(ABILITY_TYPE.HELP)), 'common.login_required')
def test_activate_ability(self): self.request_login(self.account.email) response = self.client.post(use_ability_url(ABILITY_TYPE.HELP)) task = PostponedTaskPrototype._db_get_object(0) self.check_ajax_processing(response, task.status_url)
def test_activate_ability(self): self.request_login('*****@*****.**') response = self.client.post(use_ability_url(ABILITY_TYPE.HELP)) task = PostponedTaskPrototype._db_get_object(0) self.check_ajax_processing(response, task.status_url)
def test_activate_ability_unlogined(self): self.check_ajax_error(self.client.post(use_ability_url(ABILITY_TYPE.HELP)), 'common.login_required')
def use_ability_url(ability, building=None, battle=None): return jinja2.Markup( logic.use_ability_url(ability=ability, building=building, battle=battle))
def test_activate_ability__no_energy(self): self.request_login(self.account.email) self.check_ajax_error( self.client.post(use_ability_url(ABILITY_TYPE.HELP)), 'game.abilities.use.no_enough_energy') self.assertEqual(PostponedTaskPrototype._db_count(), 0)
def use_ability_url(ability, building=None, battle=None): return jinja2.Markup(logic.use_ability_url(ability=ability, building=building, battle=battle))