From b54c76b9fd8a6bcb85b4b6e27194786106190762 Mon Sep 17 00:00:00 2001 From: Shawn Campbell Date: Fri, 5 Sep 2014 17:56:50 -0400 Subject: [PATCH] cleaned up test a little to show problem in a cleaner way --- #.gitignore# | 23 +++++++++++++++++++++++ tests/test_filters.py | 8 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 #.gitignore# diff --git a/#.gitignore# b/#.gitignore# new file mode 100644 index 000000000..088160a36 --- /dev/null +++ b/#.gitignore# @@ -0,0 +1,23 @@ +*.pyc +*.db +*~ +.* + +html/ +htmlcov/ +coverage/ +build/ +dist/ +*.egg-info/ +MANIFEST + +bin/ +include/ +lib/ +local/ + +*.iml +atlassian-ide-plugin.xml + +!.gitignore +!.travis.yml diff --git a/tests/test_filters.py b/tests/test_filters.py index a1b3b2a00..bc3e070a9 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -769,8 +769,8 @@ class Iso8601DateTimeFilter(TestCase): # This shows that the you cannot filter via an isoformatted datetime self.assertNotEqual(response.data, expected_data) # This shows that the issues is not Django filters itself but how the filters are built via iexact - should_find_something = FilterableISO8601Item.objects.filter(date__iexact=search_date.isoformat()) - should_find_something_2 = FilterableISO8601Item.objects.filter(date=search_date.isoformat()) - self.assertEqual(should_find_something.count(), 0) + should_not_find_something = FilterableISO8601Item.objects.filter(date__iexact=search_date.isoformat()) + should_find_something = FilterableISO8601Item.objects.filter(date=search_date.isoformat()) + self.assertEqual(should_not_find_something.count(), 0) # The issue is that dates are being filtered via an iexact filter which does date comparision - self.assertNotEqual(should_find_something.query.__str__(), should_find_something_2.query.__str__()) + self.assertNotEqual(should_find_something.count(), should_not_find_something.count())