mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-08-02 19:20:14 +03:00
added return from insert method
This commit is contained in:
parent
232a8d29ad
commit
5d4e4ca770
|
@ -245,7 +245,7 @@ class Database(object):
|
|||
# Return any remaining lines in partial batch
|
||||
if lines:
|
||||
yield buf.getvalue()
|
||||
self._send(gen())
|
||||
return self._send(gen())
|
||||
|
||||
def count(self, model_class, conditions=None):
|
||||
'''
|
||||
|
|
|
@ -46,6 +46,11 @@ class DatabaseTestCase(TestCaseWithData):
|
|||
self.assertEqual(str(t.b), '2020-01-01')
|
||||
self.assertEqual(t.d, 35)
|
||||
|
||||
def test_insert__response(self):
|
||||
from requests import Response
|
||||
response = self.database.insert(next(self._sample_data()))
|
||||
self.assertTrue(isinstance(response, Response))
|
||||
|
||||
def test_count(self):
|
||||
self.database.insert(self._sample_data())
|
||||
self.assertEqual(self.database.count(Person), 100)
|
||||
|
|
Loading…
Reference in New Issue
Block a user