def test_SampleToAmino_amino_acids_returns_list_of_keys_if_amino_acids_exist_when_created(self): make_fake_patient_with_3_clonotypes() s = Sample.objects.get() s2a = SampleToAmino(sample=s) s2a.save() aa_keys = [aa.id for aa in AminoAcid.objects.all()] self.assertEquals(aa_keys, s2a.amino_acids)
def test_create_samples_for_a_patient(self): make_fake_patient_with_3_clonotypes() # Try retreiving the sample from the database s = Sample.objects.get() all_samples = Sample.objects.all() self.assertEqual(len(all_samples), 1) # Check to see if the attributes have been saved # Make sure the sample is linked to the patient self.assertEqual(all_samples[0].patient, s.patient)
def test_SampleToAmino_update_stores_amino_acid_keys_as_json_in_db(self): make_fake_patient_with_3_clonotypes() s = Sample.objects.get() s2a = SampleToAmino(sample=s) s2a.save() self.assertEquals('[1, 2, 3]', s2a._amino_acids)
def setUp(self): make_fake_patient_with_3_clonotypes()
def setUp(self): self.renderPatch = patch('clonotypes.views.render', render_echo) self.renderPatch.start() self.request = FakeRequestFactory() make_fake_patient_with_3_clonotypes()
def test_j_gene_names_returns_list_of_distinct_j_gene_names(self): make_fake_patient_with_3_clonotypes() self.assertIsInstance(Recombination.j_gene_names(), list) self.assertEqual( [u'TRBJ1-1', u'TRBJ2-4'], Recombination.j_gene_names())
def test_functionality_states_returns_list_of_all_functionality_states_in_db(self): make_fake_patient_with_3_clonotypes() self.assertIsInstance(Recombination.functionality_states(), list) self.assertEqual([u'Productive', u'Out of frame'], Recombination.functionality_states())
def setUp(self): make_fake_patient_with_3_clonotypes() self.s = Sample.objects.get()
def setUp(self): make_fake_patient_with_3_clonotypes() self.s = Sample.objects.get() self.f = ClonoFilter(sample=self.s) self.f.save()
def test_samples_have_a_draw_date(self): make_fake_patient_with_3_clonotypes() # Retrieve the sample from the db all_samples = Sample.objects.all() # make sure the draw dates are equal self.assertTrue(all_samples[0].draw_date)