cleaned up test a little to show problem in a cleaner way

This commit is contained in:
Shawn Campbell 2014-09-05 17:56:50 -04:00
parent bd225c49ce
commit b54c76b9fd
2 changed files with 27 additions and 4 deletions

23
#.gitignore# Normal file
View File

@ -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

View File

@ -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())