diff --git a/ippisite/ippidb/tests/tests_contribute_e2e.py b/ippisite/ippidb/tests/tests_contribute_e2e.py
index c6c0058f15453bbf55e63f37e41e3555dd264b5d..31342c88169ef7f446d449dcdd83cf9ef7d0326f 100644
--- a/ippisite/ippidb/tests/tests_contribute_e2e.py
+++ b/ippisite/ippidb/tests/tests_contribute_e2e.py
@@ -578,7 +578,10 @@ class ContributionE2ETestCase(TestCase):
                 comp = models.Compound.objects.get(iupac_name=c["molecule_iupac"])
             # test ligand ID has been stored if the X ray data option is checked
             if entry_data.get("xray", False) is True:
-                self.assertEqual(comp.ligand_id, c.get("ligand_id", None))
+                ligand_id = c.get("ligand_id", None)
+                if ligand_id is not None:
+                    ligand_id = str(ligand_id)
+                self.assertEqual(comp.ligand_id, ligand_id)
         # test activity
         bibliography = models.Bibliography.objects.get(
             id_source=entry_data["id_source"].strip()