def test_baseEntityMatch_externalIdCompare(self):
     charge = StateCharge.new_with_defaults(external_id=_EXTERNAL_ID)
     charge_another = StateCharge.new_with_defaults()
     self.assertFalse(
         base_entity_match(ingested_entity=EntityTree(entity=charge,
                                                      ancestor_chain=[]),
                           db_entity=EntityTree(entity=charge_another,
                                                ancestor_chain=[])))
     charge_another.external_id = _EXTERNAL_ID
     self.assertTrue(
         base_entity_match(ingested_entity=EntityTree(entity=charge,
                                                      ancestor_chain=[]),
                           db_entity=EntityTree(entity=charge_another,
                                                ancestor_chain=[])))
 def test_baseEntityMatch_flatFieldsCompare(self):
     charge = StateCharge.new_with_defaults(state_code=_STATE_CODE,
                                            county_code=_COUNTY_CODE)
     charge_another = StateCharge.new_with_defaults(state_code=_STATE_CODE)
     self.assertFalse(
         base_entity_match(ingested_entity=EntityTree(entity=charge,
                                                      ancestor_chain=[]),
                           db_entity=EntityTree(entity=charge_another,
                                                ancestor_chain=[])))
     charge_another.county_code = _COUNTY_CODE
     self.assertTrue(
         base_entity_match(ingested_entity=EntityTree(entity=charge,
                                                      ancestor_chain=[]),
                           db_entity=EntityTree(entity=charge_another,
                                                ancestor_chain=[])))
 def test_baseEntityMatch_placeholder(self):
     charge = StateCharge.new_with_defaults()
     charge_another = StateCharge.new_with_defaults()
     self.assertFalse(
         base_entity_match(ingested_entity=EntityTree(entity=charge,
                                                      ancestor_chain=[]),
                           db_entity=EntityTree(entity=charge_another,
                                                ancestor_chain=[])))