def test_matching_record_filtering_self(self): hasher = HasherDataModel(self.hasher_id, mother_kennel=self.kennel, hash_name=self.name, user=self.user) hasher.save() self.assertListEqual(HasherDataModel.matching_records(hasher), list())
def test_matching_record_with_different_users(self): HasherDataModel(self.hasher_id, mother_kennel=self.kennel, hash_name=self.name, user=self.user).save() hasher = HasherDataModel(self.hasher_id, mother_kennel=self.kennel, hash_name=self.name, user='******') self.assertListEqual(HasherDataModel.matching_records(hasher), list())
def test_matching_records_multiple_close_matches(self): HasherDataModel( 'hasher1', mother_kennel=self.kennel, hash_name=self.name, user=self.user, ).save() two = HasherDataModel('hasher2', mother_kennel=self.kennel, hash_name=self.name, user='******') two.save() HasherDataModel('hasher3', mother_kennel=self.kennel, hash_name=self.name, user='******').save() hasher = HasherDataModel('hasher4', mother_kennel=self.kennel, hash_name=self.name, user='******') self.assertListEqual(HasherDataModel.matching_records(hasher), [two])
def test_matching_records_does_not_exist(self): hasher = HasherDataModel(self.hasher_id, mother_kennel=self.kennel, hash_name=self.name, user=self.user) self.assertListEqual(HasherDataModel.matching_records(hasher), list())