示例#1
0
    def test_form_invalid(self):
        self.request_login(self.account.email)

        self.hero.cards.add_card(self.card)
        heroes_logic.save_hero(self.hero)

        self.check_ajax_error(self.post_ajax_json(logic.use_card_url(self.card.uid),
                                                  self.post_data(self.card.uid, place_id=666, building_id=666, person_id=666)), 'form_errors')
示例#2
0
    def test_success(self):
        self.request_login(self.account.email)

        self.hero.cards.add_card(self.card)
        heroes_logic.save_hero(self.hero)

        response = self.post_ajax_json(logic.use_card_url(self.card.uid), self.post_data(self.card.uid))
        task = PostponedTaskPrototype._db_get_object(0)

        self.check_ajax_processing(response, task.status_url)

        task.remove()
示例#3
0
    def test_success(self):
        self.request_login(self.account.email)

        self.hero.cards.add_card(self.card)
        self.hero.save()

        response = self.post_ajax_json(logic.use_card_url(self.card.uid), self.post_data(self.card.uid))
        task = common_postponed_tasks.PostponedTaskPrototype._db_get_object(0)

        self.check_ajax_processing(response, task.status_url)

        task.remove()
示例#4
0
 def test_no_cards(self):
     self.request_login(self.account.email)
     self.check_ajax_error(self.post_ajax_json(logic.use_card_url(666)), 'card.wrong_value')
示例#5
0
 def test_unlogined(self):
     self.check_ajax_error(self.post_ajax_json(logic.use_card_url(666), self.post_data(666)), 'common.login_required')
示例#6
0
 def test_no_cards(self):
     self.request_login(self.account.email)
     self.check_ajax_error(self.post_ajax_json(logic.use_card_url(666)), 'card.wrong_value')
示例#7
0
 def test_unlogined(self):
     self.check_ajax_error(self.post_ajax_json(logic.use_card_url(666), self.post_data(666)), 'common.login_required')
示例#8
0
def use_card_url(card_uid):
    return jinja2.Markup(logic.use_card_url(card_uid))
示例#9
-1
    def test_form_invalid(self):
        self.request_login(self.account.email)

        self.hero.cards.add_card(self.card)
        self.hero.save()

        self.check_ajax_error(self.post_ajax_json(logic.use_card_url(self.card.uid),
                                                  self.post_data(self.card.uid, place_id=666, building_id=666, person_id=666)), 'form_errors')