Work on updating eve_proxy for Django 1.4 and TZ support.

This commit is contained in:
2012-05-20 11:31:56 +01:00
parent c03989bd00
commit e1dc20ff2e
5 changed files with 45 additions and 41 deletions

View File

@@ -4,6 +4,7 @@ from datetime import datetime
import time
from django.utils import unittest
from django.utils.timezone import now
from eve_proxy.models import CachedDocument
from eve_proxy.exceptions import *
@@ -40,8 +41,8 @@ class CachedDocumentTestCase(unittest.TestCase):
""" Tests if objects are being cached correctly """
url = '/server/ServerStatus.xml.aspx'
obj = CachedDocument.objects.api_query(url, no_cache=True)
obj2 = CachedDocument.objects.api_query(url)
obj = CachedDocument.objects.api_query(url, no_cache=True)
obj2 = CachedDocument.objects.api_query(url)
self.assertEqual(obj.pk, obj2.pk, "Objects are not caching correctly")
@@ -51,7 +52,7 @@ class CachedDocumentTestCase(unittest.TestCase):
url = '/server/ServerStatus.xml.aspx'
obj = CachedDocument.objects.api_query(url, no_cache=True)
ret_time = obj.time_retrieved
obj.cached_until = datetime.utcnow()
obj.cached_until = now()
obj.save()
time.sleep(1)