def test_extract_investigator_multiple_cases(self):
     investigator = InvestigatorFactory(first_name='Luke', last_name='Skywalker')
     InvestigatorAllegationFactory.create_batch(3, investigator=investigator)
     rows = self.extract_data()
     expect(rows).to.have.length(3)
     for row in rows:
         expect(row['involvements']).to.have.length(1)
         expect(row['involvements'][0]['full_name']).to.eq('Luke Skywalker')
 def test_investigator_num_cases(self):
     investigator = InvestigatorFactory()
     InvestigatorAllegationFactory.create_batch(3, investigator=investigator)
     allegation = AllegationFactory()
     InvestigatorAllegationFactory(investigator=investigator, allegation=allegation)
     rows = self.extract_data()
     expect(rows).to.have.length(4)
     expect(rows[-1]['involvements']).to.have.length(1)
     expect(rows[-1]['involvements'][0]['num_cases']).to.eq(4)