def test_search_single_value(self): """Test search using a single value.""" query = Dataset() query.QueryRetrieveLevel = 'PATIENT' query.PatientName = 'CompressedSamples^CT1' q = db._search_single_value(query['PatientName'], self.session) assert 1 == len(q.all())
def test_search_single_value_subquery(self): """Test searching using a single value within an existing query.""" query = Dataset() query.QueryRetrieveLevel = 'PATIENT' query.PatientName = None q = db._search_universal(query['PatientName'], self.session) assert 5 == len(q.all()) query.PatientName = 'CompressedSamples^CT1' q = db._search_single_value(query['PatientName'], self.session, q) assert 1 == len(q.all())