summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt6
-rw-r--r--pyramid/events.py2
-rw-r--r--pyramid/tests/test_integration.py9
-rw-r--r--pyramid/tests/test_static.py8
4 files changed, 20 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 047db6472..dc74ea7a8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,12 @@ Features
- Lone instance methods can now be treated as view callables (see
https://github.com/Pylons/pyramid/pull/283).
+Bug Fixes
+---------
+
+- Make test suite pass on 32-bit systems; closes #286. closes #306.
+ See also https://github.com/Pylons/pyramid/issues/286
+
Backwards Incompatibilities
---------------------------
diff --git a/pyramid/events.py b/pyramid/events.py
index a495d9c29..bc49096af 100644
--- a/pyramid/events.py
+++ b/pyramid/events.py
@@ -172,7 +172,7 @@ class BeforeRender(dict):
This event object iself has a dictionary-like interface that can be used
for this purpose. For example::
- from repoze.events import subscriber
+ from pyramid.events import subscriber
from pyramid.events import BeforeRender
@subscriber(BeforeRender)
diff --git a/pyramid/tests/test_integration.py b/pyramid/tests/test_integration.py
index 0c17b88ce..2210f8fff 100644
--- a/pyramid/tests/test_integration.py
+++ b/pyramid/tests/test_integration.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
+import datetime
import os
import unittest
@@ -11,6 +12,9 @@ from pyramid.compat import url_quote
from zope.interface import Interface
+# 5 years from now (more or less)
+fiveyrsfuture = datetime.datetime.utcnow() + datetime.timedelta(5*365)
+
class INothing(Interface):
pass
@@ -92,7 +96,7 @@ class TestStaticAppBase(IntegrationBase):
def test_not_modified(self):
self.testapp.extra_environ = {
- 'HTTP_IF_MODIFIED_SINCE':httpdate(pow(2, 32)-1)}
+ 'HTTP_IF_MODIFIED_SINCE':httpdate(fiveyrsfuture)}
res = self.testapp.get('/minimal.pt', status=304)
self.assertEqual(res.body, b'')
@@ -574,7 +578,8 @@ class DummyRequest:
def httpdate(ts):
import datetime
- ts = datetime.datetime.utcfromtimestamp(ts)
+ if isinstance(ts, int):
+ ts = datetime.datetime.utcfromtimestamp(ts)
return ts.strftime("%a, %d %b %Y %H:%M:%S GMT")
def read_(filename):
diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py
index 9fdf29637..a04a47397 100644
--- a/pyramid/tests/test_static.py
+++ b/pyramid/tests/test_static.py
@@ -1,5 +1,9 @@
+import datetime
import unittest
+# 5 years from now (more or less)
+fiveyrsfuture = datetime.datetime.utcnow() + datetime.timedelta(5*365)
+
class Test_static_view_use_subpath_False(unittest.TestCase):
def _getTargetClass(self):
from pyramid.static import static_view
@@ -138,7 +142,7 @@ class Test_static_view_use_subpath_False(unittest.TestCase):
def test_resource_notmodified(self):
inst = self._makeOne('pyramid.tests:fixtures/static')
request = self._makeRequest({'PATH_INFO':'/index.html'})
- request.if_modified_since = pow(2, 32) -1
+ request.if_modified_since = fiveyrsfuture
context = DummyContext()
response = inst(context, request)
start_response = DummyStartResponse()
@@ -303,7 +307,7 @@ class Test_static_view_use_subpath_True(unittest.TestCase):
def test_resource_notmodified(self):
inst = self._makeOne('pyramid.tests:fixtures/static')
request = self._makeRequest()
- request.if_modified_since = pow(2, 32) -1
+ request.if_modified_since = fiveyrsfuture
request.subpath = ('index.html',)
context = DummyContext()
response = inst(context, request)