Commit a8f2724b authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

fix tests according to latest code modifications

code mods related to #225 and #226
parent 693e5f5e
Pipeline #33219 passed with stages
in 16 minutes and 12 seconds
......@@ -5,8 +5,10 @@ import django.db.models.deletion
from ippidb.tasks import generate_protein_domain_complex_groups
def run_generate_protein_domain_complex_groups(apps, schema_editor):
generate_protein_domain_complex_groups()
generate_protein_domain_complex_groups(apps)
class Migration(migrations.Migration):
......
......@@ -1531,7 +1531,7 @@ class Contribution(models.Model):
validated = models.BooleanField(default=False)
def get_absolute_url(self):
return reverse("contribution-detail", kwargs={"contribution_pk": self.pk})
return reverse("contribution-detail", kwargs={"pk": self.pk})
def update_compound_cached_properties(compounds_queryset=None):
......
......@@ -220,12 +220,19 @@ def validate(compound_ids: List[int]) -> List[int]:
pdpc.set_group()
def generate_protein_domain_complex_groups():
def generate_protein_domain_complex_groups(apps_for_import=None):
"""
Generate Protein Domain Complex groups
for all validated contributions
and pre-contribution PPIs
"""
if apps_for_import is not None:
ProteinDomainBoundComplex = apps_for_import.get_model(
"ippidb", "ProteinDomainBoundComplex"
)
ProteinDomainPartnerComplex = apps_for_import.get_model(
"ippidb", "ProteinDomainPartnerComplex"
)
ProteinDomainBoundComplexGroup.objects.all().delete()
ProteinDomainPartnerComplexGroup.objects.all().delete()
for contribution in Contribution.objects.filter(validated=True):
......
......@@ -229,7 +229,7 @@ class ContributionE2ETestCase(TestCase):
)
self.assertEqual(
response.url,
reverse("contribution-detail", kwargs={"contribution_pk": 1}),
reverse("contribution-detail", kwargs={"pk": 1}),
"wrong final URL, should be the contribution permanent URL",
)
......
......@@ -23,7 +23,7 @@ tested_urlpatterns = [
# "biblio-view",
# "ppi-view",
# "contribution-detail",
"admin-session-update",
# "admin-session-update",
# "mol2smi",
# "smi2mol",
# "smi2iupac",
......
......@@ -557,7 +557,7 @@ class IppiWizard(
f" thank you for your contribution.",
)
return redirect(
reverse("contribution-detail", kwargs={"contribution_pk": contribution.pk})
reverse("contribution-detail", kwargs={"pk": contribution.pk})
)
def get(self, *args, **kwargs):
......
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