Example #1
0
 def test_booking_match_open_bookings(self):
     db_booking = entities.Booking.new_with_defaults(
         admission_date=_DATE,
         admission_date_inferred=True
     )
     ingested_booking = entities.Booking.new_with_defaults()
     self.assertTrue(county_matching_utils.is_booking_match(
         db_entity=db_booking, ingested_entity=ingested_booking))
     ingested_booking.custody_status = CustodyStatus.RELEASED
     self.assertFalse(county_matching_utils.is_booking_match(
         db_entity=db_booking, ingested_entity=ingested_booking))
 def test_booking_match_admission_date(self):
     db_booking = entities.Booking.new_with_defaults(admission_date=_DATE)
     ingested_booking = entities.Booking.new_with_defaults(
         admission_date=_DATE)
     self.assertTrue(
         county_matching_utils.is_booking_match(
             db_entity=db_booking, ingested_entity=ingested_booking))
     ingested_booking.admission_date = None
     self.assertFalse(
         county_matching_utils.is_booking_match(
             db_entity=db_booking, ingested_entity=ingested_booking))
Example #3
0
 def test_booking_match_external_id(self):
     db_booking = entities.Booking.new_with_defaults(
         external_id=_EXTERNAL_ID
     )
     ingested_booking = entities.Booking.new_with_defaults(
         external_id=_EXTERNAL_ID
     )
     self.assertTrue(county_matching_utils.is_booking_match(
         db_entity=db_booking, ingested_entity=ingested_booking))
     ingested_booking.external_id = _EXTERNAL_ID_OTHER
     self.assertFalse(county_matching_utils.is_booking_match(
         db_entity=db_booking, ingested_entity=ingested_booking))