Skip to content

Commit

Permalink
Drop UUID field condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan P Kilby committed Oct 19, 2015
1 parent 3d4a4e6 commit 2733907
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
2 changes: 0 additions & 2 deletions django_filters/fields.py
Expand Up @@ -11,8 +11,6 @@

from .widgets import RangeWidget, LookupTypeWidget

from django.forms import UUIDField


class RangeField(forms.MultiValueField):
widget = RangeWidget
Expand Down
4 changes: 2 additions & 2 deletions django_filters/filters.py
Expand Up @@ -12,7 +12,7 @@
from django.utils.translation import ugettext_lazy as _

from .fields import (
RangeField, LookupTypeField, Lookup, DateRangeField, TimeRangeField, IsoDateTimeField, UUIDField)
RangeField, LookupTypeField, Lookup, DateRangeField, TimeRangeField, IsoDateTimeField)


__all__ = [
Expand Down Expand Up @@ -107,7 +107,7 @@ class TypedChoiceFilter(Filter):


class UUIDFilter(Filter):
field_class = UUIDField
field_class = forms.UUIDField


class MultipleChoiceFilter(Filter):
Expand Down
12 changes: 1 addition & 11 deletions tests/test_fields.py
Expand Up @@ -12,23 +12,13 @@

from django_filters.widgets import RangeWidget
from django_filters.fields import (
RangeField, LookupTypeField, Lookup, DateRangeField, TimeRangeField, IsoDateTimeField, UUIDField)
RangeField, LookupTypeField, Lookup, DateRangeField, TimeRangeField, IsoDateTimeField)


def to_d(float_value):
return decimal.Decimal('%.2f' % float_value)


class UUIDFieldTests(TestCase):

def test_field(self):
if django.VERSION < (1, 8):
with self.assertRaises(ImportError):
UUIDField()
else:
self.assertIs(UUIDField, forms.UUIDField)


class RangeFieldTests(TestCase):

def test_field(self):
Expand Down
5 changes: 2 additions & 3 deletions tests/test_filters.py
Expand Up @@ -15,8 +15,7 @@
RangeField,
DateRangeField,
TimeRangeField,
LookupTypeField,
UUIDField)
LookupTypeField)
from django_filters.filters import (
Filter,
CharFilter,
Expand Down Expand Up @@ -203,7 +202,7 @@ def test_default_field(self):
if not django.VERSION < (1, 8):
f = UUIDFilter()
field = f.field
self.assertIsInstance(field, UUIDField)
self.assertIsInstance(field, forms.UUIDField)
else:
with self.assertRaises(ImportError):
UUIDFilter().field
Expand Down

0 comments on commit 2733907

Please sign in to comment.