Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed generic view test which was failing on Postgres and MySQL.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6407 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2d1d7e453c03f4585e8fed803d31deaeef3c2ee0 1 parent f2101ab
@freakboy3742 freakboy3742 authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 tests/regressiontests/views/tests/generic/date_based.py
View
10 tests/regressiontests/views/tests/generic/date_based.py
@@ -43,9 +43,9 @@ def test_archive_month_includes_only_month(self):
author.save()
# 2004 was a leap year, so it should be weird enough to not cheat
- first_second_of_feb = datetime(2004, 2, 1, 0, 0, 0)
- first_second_of_mar = datetime(2004, 3, 1, 0, 0, 0)
- one_microsecond = timedelta(0, 0, 1)
+ first_second_of_feb = datetime(2004, 2, 1, 0, 0, 1)
+ first_second_of_mar = datetime(2004, 3, 1, 0, 0, 1)
+ two_seconds = timedelta(0, 2, 0)
article = Article(title="example", author=author)
article.date_created = first_second_of_feb
@@ -53,12 +53,12 @@ def test_archive_month_includes_only_month(self):
response = self.client.get('/views/date_based/archive_month/2004/02/')
self.assertEqual(response.status_code, 200)
- article.date_created = first_second_of_feb-one_microsecond
+ article.date_created = first_second_of_feb-two_seconds
article.save()
response = self.client.get('/views/date_based/archive_month/2004/02/')
self.assertEqual(response.status_code, 404)
- article.date_created = first_second_of_mar-one_microsecond
+ article.date_created = first_second_of_mar-two_seconds
article.save()
response = self.client.get('/views/date_based/archive_month/2004/02/')
self.assertEqual(response.status_code, 200)
Please sign in to comment.
Something went wrong with that request. Please try again.