From 3772084cbf0c6f2319630b80070c728588ef5d96 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 3 Oct 2017 10:26:55 +0200 Subject: [PATCH] Adjust test_histcategory for NOT NULL constraints --- tests/unit/completion/test_histcategory.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/unit/completion/test_histcategory.py b/tests/unit/completion/test_histcategory.py index 8ae3bb1f4..c093513cb 100644 --- a/tests/unit/completion/test_histcategory.py +++ b/tests/unit/completion/test_histcategory.py @@ -140,20 +140,24 @@ def test_sorting(max_items, before, after, model_validator, hist, config_stub): def test_remove_rows(hist, model_validator): - hist.insert({'url': 'foo', 'title': 'Foo'}) - hist.insert({'url': 'bar', 'title': 'Bar'}) + hist.insert({'url': 'foo', 'title': 'Foo', 'last_atime': 0}) + hist.insert({'url': 'bar', 'title': 'Bar', 'last_atime': 0}) cat = histcategory.HistoryCategory() model_validator.set_model(cat) cat.set_pattern('') hist.delete('url', 'foo') cat.removeRows(0, 1) - model_validator.validate([('bar', 'Bar', '')]) + model_validator.validate([('bar', 'Bar', '1970-01-01')]) def test_remove_rows_fetch(hist): """removeRows should fetch enough data to make the current index valid.""" # we cannot use model_validator as it will fetch everything up front - hist.insert_batch({'url': [str(i) for i in range(300)]}) + hist.insert_batch({ + 'url': [str(i) for i in range(300)], + 'title': [str(i) for i in range(300)], + 'last_atime': [0] * 300, + }) cat = histcategory.HistoryCategory() cat.set_pattern('')