Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def test_SampleToAmino_returns_only_aminos_belonging_to_a_patient(self):
     ClonotypeFactory()
     s = Sample.objects.get()
     aa_keys = [aa.id for aa in AminoAcid.objects.all()]
     ClonotypeFactory()
     s2a = SampleToAmino(sample=s)
     s2a.save()
     self.assertEquals(aa_keys, s2a.amino_acids)
Exemplo n.º 3
0
 def test_SampleToAmino_amino_acids_returns_empty_list_if_update_has_not_been_called(self):
     s = SampleFactory()
     s2a = SampleToAmino(sample=s)
     s2a.save()
     self.assertEquals([], s2a.amino_acids)
Exemplo n.º 4
0
 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)