fix: add batch handler logic to remove row
also execute() can return whatever it wants, e.g. when creating some new record(s) based on batch data
This commit is contained in:
parent
6d16aa0c02
commit
b3ec7cb9b8
2 changed files with 72 additions and 1 deletions
|
@ -115,6 +115,21 @@ else:
|
|||
handler.add_row(batch, row)
|
||||
self.assertEqual(batch.row_count, 1)
|
||||
|
||||
def test_remove_row(self):
|
||||
model = self.app.model
|
||||
handler = self.make_handler()
|
||||
user = model.User(username='barney')
|
||||
self.session.add(user)
|
||||
batch = handler.make_batch(self.session, created_by=user)
|
||||
self.session.add(batch)
|
||||
row = handler.make_row()
|
||||
handler.add_row(batch, row)
|
||||
self.session.flush()
|
||||
self.assertEqual(batch.row_count, 1)
|
||||
handler.do_remove_row(row)
|
||||
self.session.flush()
|
||||
self.assertEqual(batch.row_count, 0)
|
||||
|
||||
def test_do_execute(self):
|
||||
model = self.app.model
|
||||
user = model.User(username='barney')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue