From ccc2629a131aee551edb2e6dff4e56d608f09af2 Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Tue, 2 Jul 2019 10:56:43 +0200
Subject: [PATCH] Allow to have two proteins with the same gene_name and
 distinct uniprot_id

---
 ippisite/ippidb/tests.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ippisite/ippidb/tests.py b/ippisite/ippidb/tests.py
index 7d73abd5..d3d699c5 100644
--- a/ippisite/ippidb/tests.py
+++ b/ippisite/ippidb/tests.py
@@ -10,7 +10,7 @@ from django.urls import reverse
 from django.contrib.auth import get_user_model
 from openbabel import vectorUnsignedInt, OBFingerprint
 
-from ippidb import ws
+from ippidb import ws, models
 from ippidb.ws import get_uniprot_info
 from .models import Compound, CompoundTanimoto, create_tanimoto, update_compound_cached_properties, Symmetry
 from .models import DrugBankCompound
@@ -633,3 +633,10 @@ class TestConvertIUPACToSMILESAndMore(TestCase):
     def test_invalide_entry(self):
         self.assertRaises(ws.EntryNotFoundError, ws.convert_iupac_to_smiles_and_inchi, '3-{1-oxo-6-[4-(piperid')
         self.assertRaises(ws.EntryNotFoundError, ws.convert_iupac_to_smiles_and_inchi, None)
+
+
+class DuplicateGeneNameTestCase(TestCase):
+
+    def test_works(self):
+        models.Protein.objects.get_or_create(uniprot_id='P12497')
+        models.Protein.objects.get_or_create(uniprot_id='P0C6F2')
\ No newline at end of file
-- 
GitLab