Skip to content

Commit

Permalink
Merge pull request #79 from open-zaak/feature/remove-django-choices
Browse files Browse the repository at this point in the history
Feature/remove django choices
  • Loading branch information
annashamray authored Sep 18, 2023
2 parents 974044c + f6d41ed commit 6ff1ce1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ jobs:
run: cd alfresco && docker-compose up -d

- name: Install dependencies
run: pip install tox tox-gh-actions codecov
run: pip install tox tox-gh-actions

- name: Run tests
run: |
export TOXENV=py${PYTHON_VERSION/./}-django${DJANGO/./}-$(echo $CMIS_BINDING | tr '[:upper:]' '[:lower:]')
tox
codecov -e TOXENV,DJANGO --file reports/coverage-${TOXENV}.xml
run: tox
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO: ${{ matrix.django }}
CMIS_BINDING: ${{ matrix.binding }}
CMIS_URL_MAPPING_ENABLED: ${{ matrix.cmisurlmapping }}

- name: Publish coverage report
uses: codecov/codecov-action@v3

publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
Expand Down
7 changes: 3 additions & 4 deletions drc_cmis/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.utils.translation import gettext_lazy as _

import pytz
from djchoices import ChoiceItem, DjangoChoices
from solo.models import SingletonModel

from .utils.exceptions import NoOtherBaseFolderException, NoZaakBaseFolderException
Expand Down Expand Up @@ -99,9 +98,9 @@ def get_other_base_folder_name(self) -> str:
raise ImproperlyConfigured("The 'other_folder_path' must be configured.")


class Vendor(DjangoChoices):
alfresco = ChoiceItem()
bct = ChoiceItem()
class Vendor(models.TextChoices):
alfresco = "alfresco"
bct = "bct"


class UrlMapping(models.Model):
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ include_package_data = True
packages = find:
install_requires =
django>=3.2.0,<4.0
django-choices
cmislib-maykin >= 0.7.2.dev0
django-solo
iso8601
Expand Down
6 changes: 3 additions & 3 deletions tests/test_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ def test_full_update_gebruiksrechten(self):

# Create gebruiksrechten
gebruiksrechten_data = {
"informatieobject": f"https://testserver/api/v1/documenten/{document.uuid}",
"informatieobject": f"https://drc.utrechtproeftuin.nl/api/v1/documenten/{document.uuid}",
"startdatum": "2018-12-24T00:00:00Z",
"omschrijving_voorwaarden": "Test voorwaarden",
}
Expand All @@ -1543,7 +1543,7 @@ def test_full_update_gebruiksrechten(self):
self.assertEqual("Test voorwaarden", gebruiksrechten.omschrijving_voorwaarden)

updated_data = {
"informatieobject": f"https://testserver/api/v1/documenten/{document.uuid}",
"informatieobject": f"https://drc.utrechtproeftuin.nl/api/v1/documenten/{document.uuid}",
"startdatum": "2018-12-24T00:00:00Z",
"omschrijving_voorwaarden": "Aangepaste voorwaarden",
}
Expand Down Expand Up @@ -1582,7 +1582,7 @@ def test_partial_update_gebruiksrechten(self):

# Create gebruiksrechten
gebruiksrechten_data = {
"informatieobject": f"https://testserver/api/v1/documenten/{document.uuid}",
"informatieobject": f"https://drc.utrechtproeftuin.nl/api/v1/documenten/{document.uuid}",
"startdatum": "2018-12-24T00:00:00Z",
"omschrijving_voorwaarden": "Test voorwaarden",
}
Expand Down

0 comments on commit 6ff1ce1

Please sign in to comment.