Example #1
0
    def test_bill_decline__actors__convesion(self):
        from the_tale.game.chronicle.signal_processors import _get_bill_decline_bill_arguments

        bill, declined_bill = self.create_bill_decline__conversion()

        actors_ids = []
        for role, actor in _get_bill_decline_bill_arguments(bill)['actors']:
            actors_ids.append((role, actor.id))
        self.assertEqual(sorted(actors_ids), sorted([(ACTOR_ROLE.BILL, bill.id),
                                                     (ACTOR_ROLE.BILL, declined_bill.id),
                                                     (ACTOR_ROLE.PLACE, self.place_1.id)]))
Example #2
0
    def test_bill_decline__actors__convesion(self):
        from the_tale.game.chronicle.signal_processors import _get_bill_decline_bill_arguments

        bill, declined_bill = self.create_bill_decline__conversion()

        actors_ids = []
        for role, actor in _get_bill_decline_bill_arguments(bill)['actors']:
            actors_ids.append((role, actor.id))
        self.assertEqual(set(actors_ids), set([(ACTOR_ROLE.BILL, bill.id),
                                               (ACTOR_ROLE.BILL, declined_bill.id),
                                               (ACTOR_ROLE.PLACE, self.place_1.id)]))
Example #3
0
    def test_bill_decline__actors__exchange(self):
        from the_tale.game.chronicle.signal_processors import _get_bill_decline_bill_arguments

        bill, declined_bill = self.create_bill_decline__exchange()

        actors_ids = []
        for role, actor in _get_bill_decline_bill_arguments(bill)["actors"]:
            actors_ids.append((role, actor.id))
        self.assertEqual(
            sorted(actors_ids),
            sorted(
                [
                    (ACTOR_ROLE.BILL, bill.id),
                    (ACTOR_ROLE.BILL, declined_bill.id),
                    (ACTOR_ROLE.PLACE, self.place_1.id),
                    (ACTOR_ROLE.PLACE, self.place_2.id),
                ]
            ),
        )