Exemplo n.º 1
0
    def test_wrong_cards(self):
        self.request_login(self.account.email)

        for combine_status in relations.CARDS_COMBINING_STATUS.records:
            if combine_status.is_ALLOWED:
                continue

            with self.check_not_changed(PostponedTaskPrototype._db_count):
                self.check_ajax_error(self.post_ajax_json(logic.combine_cards_url((666,))), "cards.wrong_value")
Exemplo n.º 2
0
    def test_wrong_cards(self):
        self.request_login(self.account.email)

        for combine_status in relations.CARDS_COMBINING_STATUS.records:
            if combine_status.is_ALLOWED:
                continue

            with self.check_not_changed(PostponedTaskPrototype._db_count):
                self.check_ajax_error(self.post_ajax_json(logic.combine_cards_url((666,))),
                                      'cards.wrong_value')
Exemplo n.º 3
0
    def test_created(self):
        self.request_login(self.account.email)

        card_1 = objects.Card(relations.CARD_TYPE.ADD_GOLD_COMMON)
        card_2 = objects.Card(relations.CARD_TYPE.ADD_GOLD_COMMON)

        self.hero.cards.add_card(card_1)
        self.hero.cards.add_card(card_2)

        heroes_logic.save_hero(self.hero)

        with self.check_delta(PostponedTaskPrototype._db_count, 1):
            response = self.post_ajax_json(logic.combine_cards_url((card_1.uid, card_2.uid) ))

        task = PostponedTaskPrototype._db_get_object(0)

        self.check_ajax_processing(response, task.status_url)
Exemplo n.º 4
0
    def test_created(self):
        self.request_login(self.account.email)

        card_1 = objects.Card(relations.CARD_TYPE.ADD_GOLD_COMMON)
        card_2 = objects.Card(relations.CARD_TYPE.ADD_GOLD_COMMON)

        self.hero.cards.add_card(card_1)
        self.hero.cards.add_card(card_2)

        self.hero.save()

        with self.check_delta(common_postponed_tasks.PostponedTaskPrototype._db_count, 1):
            response = self.post_ajax_json(logic.combine_cards_url((card_1.uid, card_2.uid) ))

        task = common_postponed_tasks.PostponedTaskPrototype._db_get_object(0)

        self.check_ajax_processing(response, task.status_url)
Exemplo n.º 5
0
 def test_unlogined(self):
     self.check_ajax_error(self.post_ajax_json(logic.combine_cards_url(())), 'common.login_required')
Exemplo n.º 6
0
 def test_unlogined(self):
     self.check_ajax_error(self.post_ajax_json(logic.combine_cards_url(())), 'common.login_required')
Exemplo n.º 7
0
def combine_cards_url(cards_uids=None):
    return jinja2.Markup(logic.combine_cards_url(cards_uids))