def test_update_case_change(case_raw_dict, rf_courts): parser = FirstParser( court=Court.objects.filter(title='Выборгский районный суд').first(), stage=2, codex='koap') case_raw_dict['case_uid'] = 'blabla' parser.save_from_raw(case_raw_dict) c_old = Case.objects.first() c_old.update_case() assert c_old.case_uid != 'blabla'
def test_update_case_dont_remove(case_raw_dict, rf_courts): parser = FirstParser( court=Court.objects.filter(title='Выборгский районный суд').first(), stage=2, codex='koap') case_raw_dict['appeal_result'] = 'blabla' parser.save_from_raw(case_raw_dict) c_old = Case.objects.first() c_old.update_case() assert c_old.appeal_result == 'blabla'
def test_update_case_correct_defenses(case_raw_dict, rf_courts): parser = FirstParser( court=Court.objects.filter(title='Выборгский районный суд').first(), stage=2, codex='koap') error_defense_advocate_name = { 'defendant': 'Рассохин А.А.', 'codex_articles': '' } error_defense_prosecutor_name = { 'defendant': 'Ильин Н.В.', 'codex_articles': '' } case_raw_dict['defenses'].append(error_defense_advocate_name) case_raw_dict['defenses'].append(error_defense_prosecutor_name) c = parser.save_from_raw(case_raw_dict) c.update_case() # assert len(c.defenses.all()) == 1 #WTF assert len(c.get_advocates()) == 2 assert len(c.get_prosecutors()) == 2