コード例 #1
0
ファイル: test_records.py プロジェクト: he1mdallr/the-tale
    def create_bill_decline__exchange(self):
        resource_1, resource_2 = choose_exchange_resources()

        declined_bill_data = bills.PlaceResourceExchange(
            place_1_id=self.place_1.id,
            place_2_id=self.place_2.id,
            resource_1=resource_1,
            resource_2=resource_2)

        declined_bill = BillPrototype.create(
            self.account,
            'declined-bill-caption',
            'declined-bill-rationale',
            declined_bill_data,
            chronicle_on_accepted='chronicle-on-accepted')

        declined_data = declined_bill.user_form_initials
        declined_data['approved'] = True

        declined_form = bills.PlaceResourceExchange.ModeratorForm(
            declined_data)
        self.assertTrue(declined_form.is_valid())
        declined_bill.update_by_moderator(declined_form)
        declined_bill.apply()

        bill_data = bills.BillDecline(declined_bill_id=declined_bill.id)
        bill = BillPrototype.create(
            self.account,
            'bill-caption',
            'bill-rationale',
            bill_data,
            chronicle_on_accepted='chronicle-on-accepted')
        return bill, declined_bill
コード例 #2
0
ファイル: test_bill_decline.py プロジェクト: Tiendil/the-tale
    def setUp(self):
        super(BillDeclineResourceExchangeTests, self).setUp()

        self.resource_1, self.resource_2 = choose_exchange_resources()

        self.declined_bill_data = PlaceResourceExchange(
            place_1_id=self.place1.id, place_2_id=self.place2.id, resource_1=self.resource_1, resource_2=self.resource_2
        )

        self.declined_bill = BillPrototype.create(
            owner=self.account1,
            caption="declined-bill-caption",
            rationale="declined-bill-rationale",
            chronicle_on_accepted="chronicle-on-accepted",
            bill=self.declined_bill_data,
        )

        data = self.declined_bill.user_form_initials
        data["approved"] = True
        declined_form = self.declined_bill.data.get_moderator_form_update(data)

        self.assertTrue(declined_form.is_valid())
        self.declined_bill.update_by_moderator(declined_form)
        self.declined_bill.apply()

        self.bill_data = BillDecline(declined_bill_id=self.declined_bill.id)
        self.bill = BillPrototype.create(
            self.account1,
            "bill-caption",
            "bill-rationale",
            self.bill_data,
            chronicle_on_accepted="chronicle-on-accepted",
        )
コード例 #3
0
    def setUp(self):
        super(BillDeclineResourceExchangeTests, self).setUp()

        self.resource_1, self.resource_2 = choose_exchange_resources()

        self.declined_bill_data = PlaceResourceExchange(
            place_1_id=self.place1.id,
            place_2_id=self.place2.id,
            resource_1=self.resource_1,
            resource_2=self.resource_2)

        self.declined_bill = BillPrototype.create(
            owner=self.account1,
            caption='declined-bill-caption',
            chronicle_on_accepted='chronicle-on-accepted',
            bill=self.declined_bill_data)

        data = self.declined_bill.user_form_initials
        data['approved'] = True
        declined_form = self.declined_bill.data.get_moderator_form_update(data)

        self.assertTrue(declined_form.is_valid())
        self.declined_bill.update_by_moderator(declined_form)
        self.declined_bill.apply()

        self.bill_data = BillDecline(declined_bill_id=self.declined_bill.id)
        self.bill = BillPrototype.create(
            self.account1,
            'bill-caption',
            self.bill_data,
            chronicle_on_accepted='chronicle-on-accepted',
        )
コード例 #4
0
ファイル: test_records.py プロジェクト: lshestov/the-tale
    def create_bill_decline__exchange(self):
        resource_1, resource_2 = choose_exchange_resources()

        declined_bill_data = bills.PlaceResourceExchange(
            place_1_id=self.place_1.id, place_2_id=self.place_2.id, resource_1=resource_1, resource_2=resource_2
        )

        declined_bill = BillPrototype.create(
            self.account,
            "declined-bill-caption",
            "declined-bill-rationale",
            declined_bill_data,
            chronicle_on_accepted="chronicle-on-accepted",
        )

        declined_form = bills.PlaceResourceExchange.ModeratorForm({"approved": True})
        self.assertTrue(declined_form.is_valid())
        declined_bill.update_by_moderator(declined_form)
        declined_bill.apply()

        bill_data = bills.BillDecline(declined_bill_id=declined_bill.id)
        bill = BillPrototype.create(
            self.account, "bill-caption", "bill-rationale", bill_data, chronicle_on_accepted="chronicle-on-accepted"
        )
        return bill, declined_bill
コード例 #5
0
    def setUp(self):
        super(PlaceResourceExchangeTests, self).setUp()

        self.resource_1, self.resource_2 = choose_exchange_resources()

        self.bill_data = PlaceResourceExchange(place_1_id=self.place1.id,
                                               place_2_id=self.place2.id,
                                               resource_1=self.resource_1,
                                               resource_2=self.resource_2)

        self.bill = BillPrototype.create(self.account1, 'bill-1-caption', 'bill-1-rationale', self.bill_data,
                                         chronicle_on_accepted='chronicle-on-accepted')
コード例 #6
0
    def setUp(self):
        super(PlaceResourceExchangeTests, self).setUp()

        self.resource_1, self.resource_2 = choose_exchange_resources()

        self.bill_data = PlaceResourceExchange(place_1_id=self.place1.id,
                                               place_2_id=self.place2.id,
                                               resource_1=self.resource_1,
                                               resource_2=self.resource_2)

        self.bill = BillPrototype.create(
            self.account1,
            'bill-1-caption',
            self.bill_data,
            chronicle_on_accepted='chronicle-on-accepted')
コード例 #7
0
ファイル: test_signals.py プロジェクト: pavetok/the-tale
    def setUp(self):
        from the_tale.game.bills.tests.helpers import choose_exchange_resources
        from the_tale.game.bills.bills import PlaceResourceExchange

        super(BillPlaceExchangeResourcesTests, self).setUp()

        self.resource_1, self.resource_2 = choose_exchange_resources()

        self.bill_data = PlaceResourceExchange(place_1_id=self.place1.id,
                                               place_2_id=self.place2.id,
                                               resource_1=self.resource_1,
                                               resource_2=self.resource_2)

        self.bill = BillPrototype.create(self.account1, 'bill-1-caption', 'bill-1-rationale', self.bill_data, chronicle_on_accepted='chronicle-on-accepted')

        self.form = bills.PlaceModifier.ModeratorForm({'approved': True})
        self.assertTrue(self.form.is_valid())
コード例 #8
0
    def create_bill_decline__exchange(self):
        resource_1, resource_2 = choose_exchange_resources()

        declined_bill_data = bills.PlaceResourceExchange(place_1_id=self.place_1.id,
                                                         place_2_id=self.place_2.id,
                                                         resource_1=resource_1,
                                                         resource_2=resource_2)

        declined_bill = BillPrototype.create(self.account, 'declined-bill-caption', 'declined-bill-rationale', declined_bill_data, chronicle_on_accepted='chronicle-on-accepted')

        declined_data = declined_bill.user_form_initials
        declined_data['approved'] = True

        declined_form = bills.PlaceResourceExchange.ModeratorForm(declined_data)
        self.assertTrue(declined_form.is_valid())
        declined_bill.update_by_moderator(declined_form)
        declined_bill.apply()

        bill_data = bills.BillDecline(declined_bill_id=declined_bill.id)
        bill = BillPrototype.create(self.account, 'bill-caption', 'bill-rationale', bill_data, chronicle_on_accepted='chronicle-on-accepted')
        return bill, declined_bill
コード例 #9
0
    def setUp(self):
        super(BillDeclineResourceExchangeTests, self).setUp()

        self.resource_1, self.resource_2 = choose_exchange_resources()

        self.declined_bill_data = PlaceResourceExchange(place_1_id=self.place1.id,
                                                        place_2_id=self.place2.id,
                                                        resource_1=self.resource_1,
                                                        resource_2=self.resource_2)

        self.declined_bill = BillPrototype.create(owner=self.account1,
                                                  caption='declined-bill-caption',
                                                  rationale='declined-bill-rationale',
                                                  chronicle_on_accepted='chronicle-on-accepted',
                                                  bill=self.declined_bill_data)

        declined_form = PlaceResourceExchange.ModeratorForm({'approved': True})
        self.assertTrue(declined_form.is_valid())
        self.declined_bill.update_by_moderator(declined_form)
        self.declined_bill.apply()

        self.bill_data = BillDecline(declined_bill_id=self.declined_bill.id)
        self.bill = BillPrototype.create(self.account1, 'bill-caption', 'bill-rationale', self.bill_data, chronicle_on_accepted='chronicle-on-accepted',)