Skip to content

Commit bd37628

Browse files
committed
tests/test_permissions.py: do not add view perm for dj21
1 parent 6b2ed4a commit bd37628

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_permissions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import base64
44
import unittest
55

6+
import django
67
from django.contrib.auth.models import Group, Permission, User
78
from django.db import models
89
from django.test import TestCase
@@ -248,10 +249,12 @@ class BasicPermModel(models.Model):
248249

249250
class Meta:
250251
app_label = 'tests'
251-
permissions = (
252-
('view_basicpermmodel', 'Can view basic perm model'),
253-
# add, change, delete built in to django
254-
)
252+
253+
if django.VERSION <= (2, 1):
254+
permissions = (
255+
('view_basicpermmodel', 'Can view basic perm model'),
256+
# add, change, delete built in to django
257+
)
255258

256259

257260
class BasicPermSerializer(serializers.ModelSerializer):

0 commit comments

Comments
 (0)