예제 #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
파일: base.py 프로젝트: KentaYamada/siphon
 def setUp(self):
     self.db = PgAdapter()
     self.mapper = None
     self.teardown_query = ''
예제 #6
0
 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()