示例#1
0
    def test_generate_sql(self):

        transaction = Transaction(self.from_id, self.to_id, self.category,
                                  self.amount)

        result = transaction.generate_sql()

        self.assertEqual(
            "INSERT INTO transactions (from_entity, to_entity, type, balance) "
            "values (31, 21, 'bet', 50)", result)
示例#2
0
    def test_batch_generate_sql(self):
        transaction = Transaction(self.from_id, self.to_id, self.category,
                                  self.amount)

        result = transaction.generate_sql(is_batch=True)
        self.assertEqual("(31, 21, 'bet', 50)", result)