Exemplo n.º 1
0
 def test_activate_ability_unlogined(self):
     self.check_ajax_error(
         self.client.post(use_ability_url(ABILITY_TYPE.HELP)),
         'common.login_required')
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 def test_activate_ability_unlogined(self):
     self.check_ajax_error(self.client.post(use_ability_url(ABILITY_TYPE.HELP)), 'common.login_required')
Exemplo n.º 5
0
def use_ability_url(ability, building=None, battle=None):
    return jinja2.Markup(
        logic.use_ability_url(ability=ability,
                              building=building,
                              battle=battle))
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
def use_ability_url(ability, building=None, battle=None):
    return jinja2.Markup(logic.use_ability_url(ability=ability, building=building, battle=battle))