From ba60f4d3b6b564d5403e5ac2e6a6c8c5dc9b99e6 Mon Sep 17 00:00:00 2001 From: "Pavel Turinsky (DebianVM @ Zr)" Date: Tue, 22 Jun 2021 23:13:12 +0000 Subject: [PATCH] Poznamky stripovat. --- db_compare.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/db_compare.py b/db_compare.py index b76a7f5e..6eab9e27 100755 --- a/db_compare.py +++ b/db_compare.py @@ -148,7 +148,13 @@ def check_reseni(): spravna_old = list(filter(lambda o: o['id'] in new_ids, old_res)) res = zip(spravna_old,new_res) for o,n in res: - check_same(o,n,['id', 'forma', 'poznamka', 'timestamp', 'problem_id', 'body', 'cislo_body_id']) + # Tady by se poznamky i timestampy mely zachovat + # Z nejakeho duvodu se ale poznamky lisi ve whitespace, tak je zkontrolujeme separatne + check_same(o,n,['id', 'forma', 'timestamp', 'problem_id', 'body', 'cislo_body_id']) + old_pozn = o['poznamka'].strip() + new_pozn = n['poznamka'].strip() + if old_pozn != new_pozn: + raise ValueError('Poznamky se lisi pro radky {dict(o)} a {dict(n)}')