[1.4.x] -- Fixed Python 2.5 compatibility issues
This commit is contained in:
parent
1f537335d9
commit
4dba4ed548
|
@ -131,7 +131,7 @@ class FieldListFilter(ListFilter):
|
||||||
def queryset(self, request, queryset):
|
def queryset(self, request, queryset):
|
||||||
try:
|
try:
|
||||||
return queryset.filter(**self.used_parameters)
|
return queryset.filter(**self.used_parameters)
|
||||||
except ValidationError as e:
|
except ValidationError, e:
|
||||||
raise IncorrectLookupParameters(e)
|
raise IncorrectLookupParameters(e)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -43,13 +43,15 @@ class PermWrapperTests(TestCase):
|
||||||
Test that 'something' in PermWrapper doesn't end up in endless loop.
|
Test that 'something' in PermWrapper doesn't end up in endless loop.
|
||||||
"""
|
"""
|
||||||
perms = PermWrapper(MockUser())
|
perms = PermWrapper(MockUser())
|
||||||
with self.assertRaises(TypeError):
|
def raises():
|
||||||
self.EQLimiterObject() in perms
|
self.EQLimiterObject() in perms
|
||||||
|
self.assertRaises(raises, TypeError)
|
||||||
|
|
||||||
def test_permlookupdict_in(self):
|
def test_permlookupdict_in(self):
|
||||||
pldict = PermLookupDict(MockUser(), 'mockapp')
|
pldict = PermLookupDict(MockUser(), 'mockapp')
|
||||||
with self.assertRaises(TypeError):
|
def raises():
|
||||||
self.EQLimiterObject() in pldict
|
self.EQLimiterObject() in pldict
|
||||||
|
self.assertRaises(raises, TypeError)
|
||||||
|
|
||||||
|
|
||||||
class AuthContextProcessorTests(TestCase):
|
class AuthContextProcessorTests(TestCase):
|
||||||
|
|
Loading…
Reference in New Issue