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