Skip to content

Commit

Permalink
Updates in the testing matrix, skip testing EAV in Django 4.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszn committed Aug 28, 2023
1 parent 8f5204d commit 6469b6d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
django-version: [2.2.20, 3.2.12, 4.0.2]
drf-version: [3.13.1]
include:
- python-version: "3.10"
django-version: 4.1.2
drf-version: 3.14.0
variant: default
- python-version: "3.10"
django-version: 4.0.2
drf-version: 3.13.1
variant: default
- python-version: 3.9
django-version: 3.2.12
drf-version: 3.12.4
variant: default
- python-version: 3.9
django-version: 3.2.12
drf-version: 3.13.1
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
[![Python Support](https://img.shields.io/pypi/pyversions/wq.db.svg)](https://pypi.org/project/wq.db)
[![Django Support](https://img.shields.io/pypi/djversions/wq.db.svg)](https://pypi.org/project/wq.db)

**Note:** EAV mustache context helpers do not work in Django 4.1 and above.

### [Documentation][docs]

[**Installation**][installation]
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def find_wq_packages(submodule):
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
Expand All @@ -90,6 +87,7 @@ def find_wq_packages(submodule):
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Topic :: Software Development :: Libraries :: Application Frameworks',
'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Scientific/Engineering :: GIS',
Expand Down
12 changes: 12 additions & 0 deletions tests/test_custompatterns.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import unittest
from wq.db import rest
from .base import APITestCase
from rest_framework import status
import django
from django.contrib.auth.models import User
from tests.patterns_app.models import (
CustomPatternModel, CustomTypedPatternModel, CustomType,
Expand All @@ -13,6 +15,8 @@
EntitySerializerCategoryEmpty, EntitySerializerCategoryCtxt,
)

DJANGO_AFTER_4_0 = (django.VERSION[0] >= 4 and django.VERSION[1] > 0)


class CustomPatternTestCase(APITestCase):
def setUp(self):
Expand Down Expand Up @@ -188,6 +192,7 @@ def test_customtypedpattern_put(self):
self.typeinstance.attachments.first().type, self.type
)

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_empty(self):
rest.router.register_serializer(
Entity,
Expand All @@ -198,6 +203,7 @@ def test_eavfilter_empty(self):
[self.att1.id, self.att2.id, self.att3.id, self.att4.id],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_cid(self):
rest.router.register_serializer(
Entity,
Expand All @@ -209,6 +215,7 @@ def test_eavfilter_cid(self):
[self.att3.id, self.att4.id],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_cid_miss(self):
rest.router.register_serializer(
Entity,
Expand All @@ -219,6 +226,7 @@ def test_eavfilter_cid_miss(self):
[],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_isactive(self):
rest.router.register_serializer(
Entity,
Expand All @@ -238,6 +246,7 @@ def test_eavfilter_isactive(self):
[self.att2.id, self.att4.id],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_isactivecid(self):
rest.router.register_serializer(
Entity,
Expand All @@ -249,6 +258,7 @@ def test_eavfilter_isactivecid(self):
[self.att1.id],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_category(self):
rest.router.register_serializer(
Entity,
Expand All @@ -259,6 +269,7 @@ def test_eavfilter_category(self):
[self.att1.id, self.att2.id],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_category_empty(self):
rest.router.register_serializer(
Entity,
Expand All @@ -269,6 +280,7 @@ def test_eavfilter_category_empty(self):
[self.att4.id],
[i['attribute_id'] for i in response.data['values']])

@unittest.skipIf(DJANGO_AFTER_4_0, "EAV mustache context helpers do not work since Django 4.1")
def test_eavfilter_category_ctxt_empty(self):
rest.router.register_serializer(
Entity,
Expand Down

0 comments on commit 6469b6d

Please # to comment.