コード例 #1
0
    def create_party(self, party_id, title):
        party = create_party(id=party_id, title=title, brand=self.brand)

        self.db.session.add(party)
        self.db.session.commit()

        return party
コード例 #2
0
ファイル: base.py プロジェクト: homeworkprod/byceps
    def create_brand_and_party(self):
        self.brand = create_brand()
        db.session.add(self.brand)

        self.party = create_party(brand=self.brand)
        db.session.add(self.party)

        db.session.commit()
コード例 #3
0
    def create_custom_brand_and_party(self):
        brand = create_brand(id='custom', title='Custom Events')
        party = create_party(id='custom-party-4', brand=brand,
                             title='Custom Party 4')

        self._persist(brand, party)

        return party
コード例 #4
0
    def create_custom_brand_and_party(self):
        brand = create_brand(id='custom', title='Custom Events')
        party = create_party(id='custom-party-4',
                             brand=brand,
                             title='Custom Party 4')

        self._persist(brand, party)

        return party
コード例 #5
0
    def create_brand_and_party(self):
        self.brand = create_brand(id='lanresort', title='LANresort')
        self.db.session.add(self.brand)

        self.party = create_party(id='lanresort-2015',
                                  brand=self.brand,
                                  title='LANresort 2015')
        self.db.session.add(self.party)

        self.db.session.commit()
コード例 #6
0
    def test_generate_order_number_custom(self):
        last_assigned_order_serial_number = 206

        brand = create_brand(code='LOL')
        party = create_party(brand=brand, number=3)
        self.set_order_number_sequence(value=last_assigned_order_serial_number)

        actual = generate_order_number(party)

        self.assertEqual(actual, 'LOL-03-B00207')
コード例 #7
0
    def test_generate_article_number_custom(self):
        last_assigned_article_serial_number = 41

        brand = create_brand(code='XYZ')
        party = create_party(brand=brand, number=9)
        self.set_article_number_sequence(value=last_assigned_article_serial_number)

        actual = generate_article_number(party)

        self.assertEqual(actual, 'XYZ-09-A00042')
コード例 #8
0
    def create_brand_and_party(self):
        self.brand = create_brand(
            id='lanresort',
            title='LANresort')
        self.db.session.add(self.brand)

        self.party = create_party(
            id='lanresort-2015',
            brand=self.brand,
            title='LANresort 2015')
        self.db.session.add(self.party)

        self.db.session.commit()
コード例 #9
0
ファイル: test_service.py プロジェクト: homeworkprod/byceps
 def create_party(self, id, title):
     party = create_party(id=id, title=title, brand=self.brand)
     self.db.session.add(party)
     self.db.session.commit()
     return party