Commit 252e7075 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

remove protein_bound_construct field from test data (part 2)

WIP on #204
parent d8133113
Pipeline #28930 failed with stages
in 11 minutes and 22 seconds
......@@ -1674,14 +1674,6 @@ class TestsForm(forms.Form):
empty_label=None,
# widget=forms.Select(),
)
activityDesc_protein_bound_construct = forms.ModelChoiceField(
label="Bound construct",
queryset=models.TestActivityDescription.objects.values_list(
"protein_bound_construct", flat=True
).distinct(),
empty_label=None,
# widget=forms.Select(),
)
activityDesc_nb_active_compound = forms.IntegerField(label="Nb active compound")
activityDesc_is_primary = forms.ModelChoiceField(
label="Is primary",
......
......@@ -373,10 +373,6 @@ class TestActivityDescriptionImportTask(IppiDBMySQLImportTask):
tad.ppi = Ppi.objects.get(id=row[3])
tad.test_name = row[4]
tad.is_primary = row[5] == "Y"
if row[6] == "Unspecified":
tad.protein_bound_construct = "U"
elif row[6] == "Full length":
tad.protein_bound_construct = "F"
tad.test_type = row[7].upper()
tad.test_modulation_type = row[8][0]
tad.nb_active_compounds = row[9]
......
......@@ -1012,7 +1012,6 @@ class TestActivityDescription(models.Model):
("I", "Inhibition"),
("S", "Stabilization"),
)
PROTEIN_BOUND_CONSTRUCTS = (("F", "Full length"), ("U", "Unspecified"))
biblio = models.ForeignKey(Bibliography, on_delete=models.CASCADE)
protein_domain_bound_complex = models.ForeignKey(
ProteinDomainBoundComplex, on_delete=models.CASCADE
......@@ -1025,13 +1024,6 @@ class TestActivityDescription(models.Model):
is_primary = models.BooleanField(
verbose_name="Is primary", help_text=_("is_primary_help_text")
)
protein_bound_construct = models.CharField(
verbose_name="Protein bound construct",
max_length=5,
choices=PROTEIN_BOUND_CONSTRUCTS,
blank=True,
null=True,
)
test_modulation_type = models.CharField(
verbose_name="Test modulation type", max_length=1, choices=TEST_MODULATION_TYPES
)
......
......@@ -8,9 +8,6 @@
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'protein_domain_bound_complex'}}: </span>{{object.protein_domain_bound_complex}}
</div>
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'protein_bound_construct'}}: </span>{{object.protein_bound_construct}}
</div>
<div class="col-12">
<span style="font-family: BrandonGrotesqueBld;">{{object|verbose_name:'is_primary'}}: </span>{{object.is_primary}}
</div>
......
......@@ -124,3 +124,20 @@ class PDBFormTestCase(TestCase):
form.has_error("pdb_id", code="no_mapping"),
"PDB code with no Uniprot mapping (3wn8) should be rejected with no_mappping error code",
)
class PDBFormTestCase(TestCase):
"""
Test the PDB form data validation
"""
def test_valid(self):
form = PDBForm({"pdb_id": "3wn7"})
self.assertTrue(form.is_valid(), "valid PDB code should be accepted")
def test_invalid_PDB_format(self):
form = PDBForm({"pdb_id": "33wn7"})
self.assertFalse(form.is_valid(), "5 char long PDB code should be rejected")
self.assertTrue(
form.has_error("pdb_id", code="max_length"),
"5 char long PDB code should be rejected with max_length error code",
)
\ No newline at end of file
......@@ -360,9 +360,6 @@ class ContributionE2ETestCase(TestCase):
data[f"{idx}-ppi"] = ""
data[f"{idx}-test_name"] = activity_test["test_name"]
data[f"{idx}-is_primary"] = activity_test.get("is_primary", False)
data[f"{idx}-protein_bound_construct"] = activity_test[
"protein_bound_construct"
]
data[f"{idx}-test_type"] = activity_test["test_type"]
data[f"{idx}-test_modulation_type"] = activity_test[
"test_modulation_type"
......@@ -570,7 +567,6 @@ class ContributionE2ETestCase(TestCase):
tad_filters = {
"test_type": activity_test["test_type"],
"test_name": activity_test["test_name"],
"protein_bound_construct": activity_test["protein_bound_construct"],
"test_modulation_type": activity_test["test_modulation_type"],
"nb_active_compounds": activity_test["nb_active_compounds"],
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment