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