Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remove django choices #79

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed? I prefer not to have specific URLs.

Copy link
Contributor Author

@annashamray annashamray Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These "https://testserver/..." urls fail when CI runs with turned on URL mapping, because this pattern is not known for set upt UrlMapping data.
TBH I don't know why it worked before, but other Gebruiksrechten tests have "https://drc.utrechtproeftuin.nl/..." urls so I just adjusted these two tests to match

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then this will be moved to a new issue.

"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
Loading