def test_sanitize_ministry_name_part(self): test_case = ContractSanitizer._sanitize_ministry_name( Contract(ministry_ico="00023671", ministry_name='Ministerstvo')) res = Contract(ministry_ico='00023671', ministry_name='Ministerstvo kultury') self.assertEqual(res.ministry_name, test_case.ministry_name) self.assertEqual(res.ministry_ico, test_case.ministry_ico)
def test_sanitize_ministry_name_with_additional_text(self): test_case = ContractSanitizer._sanitize_ministry_name( Contract(ministry_ico="00023671", ministry_name='Česká republika - Ministerstvo kultury')) res = Contract(ministry_ico='00023671', ministry_name='Ministerstvo kultury') self.assertEqual(res.ministry_name, test_case.ministry_name) self.assertEqual(res.ministry_ico, test_case.ministry_ico)
def test_sanitize_ministry_name_ico_none(self): test_case = ContractSanitizer._sanitize_ministry_name( Contract(ministry_ico=None, ministry_name='Test s.r.o.')) res = Contract(ministry_ico=None, ministry_name='Test s.r.o.') self.assertEqual(res.ministry_name, test_case.ministry_name) self.assertEqual(res.ministry_ico, test_case.ministry_ico)
def test_sanitize_ministry_name_not_ministry(self): test_case = ContractSanitizer._sanitize_ministry_name( Contract(ministry_ico="00023600", ministry_name='Test s.r.o.')) res = Contract(ministry_ico='00023600', ministry_name='Test s.r.o.') self.assertEqual(res.ministry_name, test_case.ministry_name) self.assertEqual(res.ministry_ico, test_case.ministry_ico)