Exemplo n.º 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')
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 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')
Exemplo n.º 8
0
def use_card_url(card_uid):
    return jinja2.Markup(logic.use_card_url(card_uid))
Exemplo n.º 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')