From f359c66e09a3de5f7f26d39a7f4b0e89214a5919 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 14 Sep 2013 10:41:29 -0700 Subject: [PATCH] Fixed a PyPy compatibility issue in the test fixtures This construct didn't work under PyPy, as a result of the fact that datetime is implemented in Python in PyPy: A simplification of the problem is this: import datetime class X(datetime.datetime): pass now = datetime.datetime.now() X.isoformat(now) This works under CPython, but fails under PyPy. This is because PyPy creates a normal unbound method for `X.isoformat`, which checks that `now` is an instance of `X`, which it isn't. Because datetime is implemented in C, CPython skips those checks. Change-Id: Id27e7a8b00156bd9688bdb36d2c38b04785c2d0c --- openstack_dashboard/test/test_data/keystone_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstack_dashboard/test/test_data/keystone_data.py b/openstack_dashboard/test/test_data/keystone_data.py index 0dc7459fa5..9515b94fda 100644 --- a/openstack_dashboard/test/test_data/keystone_data.py +++ b/openstack_dashboard/test/test_data/keystone_data.py @@ -250,7 +250,7 @@ def data(TEST): TEST.tenant = tenant # Your "current" tenant tomorrow = datetime_safe.datetime.now() + timedelta(days=1) - expiration = datetime_safe.datetime.isoformat(tomorrow) + expiration = tomorrow.isoformat() scoped_token_dict = { 'access': {