示例#1
0
    def __init_data(self, data):
        query = """
            INSERT INTO sales (
                sales_date,
                sales_time,
                total_price,
                discount_price,
                discount_rate,
                inclusive_tax,
                exclusive_tax,
                deposit
            ) VALUES (
                %s,
                %s,
                %s,
                %s,
                %s,
                %s,
                %s,
                %s
            );

        """
        db = PgAdapter()
        db.bulk_insert(query, data)
        db.commit()
示例#2
0
 def tearDown(self):
     query = """
         TRUNCATE TABLE categories
         RESTART IDENTITY;
     """
     db = PgAdapter()
     db.execute(query)
     db.commit()
示例#3
0
 def tearDown(self):
     self.db = PgAdapter()
     query = """
         TRUNCATE TABLE items
         RESTART IDENTITY;
     """
     self.db.execute(query)
     self.db.commit()
示例#4
0
 def __init_data(self):
     db = PgAdapter()
     db.execute_proc('create_test_data_categories')
     db.commit()
示例#5
0
 def setUp(self):
     self.db = PgAdapter()
     self.mapper = None
     self.teardown_query = ''
 def setUp(self):
     self.mapper = CategoryMapper()
     self.db = PgAdapter()
示例#7
0
 def setUp(self):
     self.mapper = ItemMapper()
     self.db = PgAdapter()
示例#8
0
 def setUpClass(cls):
     cls.db = PgAdapter()
示例#9
0
 def setUp(self):
     self.mapper = SalesMapper()
     self.db = PgAdapter()
示例#10
0
 def tearDown(self):
     db = PgAdapter()
     db.execute_proc('cleanup_sales')
     db.commit()
示例#11
0
 def setUp(self):
     self.db = PgAdapter()
     self.endpoint = ''
     self.teardown_query = ''
示例#12
0
 def setUp(self):
     self.mapper = SalesMapper()
     self.db = PgAdapter()
     self.today = datetime.now()