Compare commits

..

1 Commits

Author SHA1 Message Date
Pierre Ducroquet 627f5a6f12 sql: test purge of search tokens (#86527)
gitea/wcs/pipeline/head This commit looks good Details
2024-03-05 11:40:52 +01:00
1 changed files with 5 additions and 5 deletions

View File

@ -1188,7 +1188,7 @@ def test_search_tokens_purge(pub):
# purge garbage from other tests
sql.purge_obsolete_search_tokens()
cur.execute('SELECT count(*) FROM wcs_search_tokens;')
start = cur.fetchone()[0]
@ -1200,7 +1200,7 @@ def test_search_tokens_purge(pub):
data_class = test_formdef.data_class(mode='sql')
cur.execute('SELECT count(*) FROM wcs_search_tokens;')
assert cur.fetchone()[0] == start+1
assert cur.fetchone()[0] == start + 1
t = data_class()
t.data = {'3': 'foofortokensofcourse'}
@ -1208,18 +1208,18 @@ def test_search_tokens_purge(pub):
t.store()
cur.execute('SELECT count(*) FROM wcs_search_tokens;')
assert cur.fetchone()[0] == start+2
assert cur.fetchone()[0] == start + 2
t.data = {'3': 'chaussettefortokensofcourse'}
t.store()
cur.execute('SELECT count(*) FROM wcs_search_tokens;')
assert cur.fetchone()[0] == start+3
assert cur.fetchone()[0] == start + 3
sql.purge_obsolete_search_tokens()
cur.execute('SELECT count(*) FROM wcs_search_tokens;')
assert cur.fetchone()[0] == start+2
assert cur.fetchone()[0] == start + 2
def table_exists(cur, table_name):