Skip to content

Commit

Permalink
Remove optional migration and tests for backport
Browse files Browse the repository at this point in the history
This migration is not strictly necessary for the import/export feature,
which is the focus of the v1.21.4 backport, to function. To avoid
migration conflicts now and in future, we'll remove the migration
and skip the tests that depend on them.
  • Loading branch information
swrichards committed Dec 5, 2024
1 parent d4a697e commit 7e16f2c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.

This file was deleted.

24 changes: 24 additions & 0 deletions src/open_inwoner/openzaak/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ class ZaakTypeConfig(models.Model):

class Meta:
verbose_name = _("Zaaktype Configuration")
constraints = [
UniqueConstraint(
name="unique_identificatie_in_catalogus",
fields=["catalogus", "identificatie"],
),
]

@property
def catalogus_url(self):
Expand Down Expand Up @@ -610,6 +616,12 @@ class ZaakTypeInformatieObjectTypeConfig(models.Model):

class Meta:
verbose_name = _("Zaaktype Information Object Configuration")
constraints = [
UniqueConstraint(
name="unique_zaaktype_config_informatieobjecttype_url",
fields=["zaaktype_config", "informatieobjecttype_url"],
)
]

def informatieobjecttype_uuid(self):
if self.informatieobjecttype_url:
Expand Down Expand Up @@ -742,6 +754,12 @@ class ZaakTypeStatusTypeConfig(models.Model):

class Meta:
verbose_name = _("Zaaktype Statustype Configuration")
constraints = [
UniqueConstraint(
name="unique_zaaktype_config_statustype_url",
fields=["zaaktype_config", "statustype_url"],
)
]

def __str__(self):
return f"{self.zaaktype_config.identificatie} - {self.omschrijving} [{self.zaaktype_config.catalogus.base_url}]"
Expand Down Expand Up @@ -786,6 +804,12 @@ class ZaakTypeResultaatTypeConfig(models.Model):

class Meta:
verbose_name = _("Zaaktype Resultaattype Configuration")
constraints = [
UniqueConstraint(
name="unique_zaaktype_config_resultaattype_url",
fields=["zaaktype_config", "resultaattype_url"],
)
]

def __str__(self):
return f"{self.zaaktype_config.identificatie} - {self.omschrijving} [{self.zaaktype_config.catalogus.base_url}]"
Expand Down
3 changes: 3 additions & 0 deletions src/open_inwoner/openzaak/tests/test_import_export.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dataclasses
import io
import uuid
from unittest import skip

from django.core.files.storage.memory import InMemoryStorage
from django.test import TestCase
Expand Down Expand Up @@ -526,6 +527,7 @@ def test_import_jsonl_update_statustype_config_missing_zt_config(self):
self.assertEqual(ZaakTypeStatusTypeConfig.objects.count(), 1)
self.assertEqual(ZaakTypeResultaatTypeConfig.objects.count(), 1)

@skip("Disabled for v1.21.4 backport")
def test_import_jsonl_update_reports_duplicate_db_records(self):
mocks = ZGWExportImportMockData()

Expand Down Expand Up @@ -565,6 +567,7 @@ def test_import_jsonl_update_reports_duplicate_db_records(self):
# check import
self.assertEqual(import_result, import_expected)

@skip("Disabled for v1.21.4 backport")
def test_import_jsonl_update_reports_duplicate_natural_keys_in_upload_file(self):
mocks = ZGWExportImportMockData(with_dupes=True)

Expand Down

0 comments on commit 7e16f2c

Please sign in to comment.