Browse Source

Zrušena kontrola řešitelských článků

middleware_test
Pavel "LEdoian" Turinsky 4 years ago
parent
commit
3ffbe08e67
  1. 28
      db_compare.py

28
db_compare.py

@ -373,20 +373,20 @@ def check_org_clanek():
raise ValueError('There exists a Org-clanek!')
def check_res_clanek():
old_query = "SELECT * FROM seminar_problemy WHERE typ = 'res-clanek' ORDER BY id"
new_query = "SELECT * FROM seminar_clanky JOIN seminar_problemy as problem ON problem_ptr_id = problem.id ORDER BY problem_ptr_id"
same_fields = []
renamed_fields = [
]
old_fields = same_fields + [f[0] for f in renamed_fields]
new_fields = same_fields + [f[1] for f in renamed_fields]
old_res, new_res = execute_simple(old_query, new_query)
res = zip(old_res,new_res)
for o,n in res:
check_same(o,n, old_fields, new_fields)
# TODO: Cislo
return; # FIXME: Je vůbec co testovat? Ta tabulka obsahuje jen problem_ptr_id a cislo_id, které ale není nikde vyplněné.
#old_query = "SELECT * FROM seminar_problemy WHERE typ = 'res-clanek' ORDER BY id"
#new_query = "SELECT * FROM seminar_clanky JOIN seminar_problemy as problem ON problem_ptr_id = problem.id ORDER BY problem_ptr_id"
#same_fields = []
#renamed_fields = []
#old_fields = same_fields + [f[0] for f in renamed_fields]
#new_fields = same_fields + [f[1] for f in renamed_fields]
#old_res, new_res = execute_simple(old_query, new_query)
#res = zip(old_res,new_res)
#for o,n in res:
# check_same(o,n, old_fields, new_fields)
## TODO: Cislo
def check_untyped_problem():
old_query = "SELECT * FROM seminar_problemy WHERE typ NOT IN ('uloha', 'tema', 'serial', 'konfera', 'org-clanek', 'res-clanek')"

Loading…
Cancel
Save