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