incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [42/50] git commit: [#4595] ticket:421 Fix occasionally failing tests
Date Thu, 05 Sep 2013 18:21:07 GMT
[#4595] ticket:421 Fix occasionally failing tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ef8c3397
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ef8c3397
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ef8c3397

Branch: refs/heads/cj/6596
Commit: ef8c33972e8920a1be17a6086bf4f0bff5c42db1
Parents: 91c7a3a
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Sep 2 13:22:51 2013 +0300
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Wed Sep 4 13:19:55 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py           | 6 ++----
 Allura/allura/tests/functional/test_site_admin.py | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ef8c3397/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index b5fa97a..0051a04 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -187,13 +187,11 @@ class SiteAdminController(object):
         try:
             start_dt = datetime.strptime(start_dt, '%Y/%m/%d %H:%M:%S')
         except ValueError:
-            start_dt = None
+            start_dt = datetime.utcnow() + timedelta(days=1)
         try:
             end_dt = datetime.strptime(end_dt, '%Y/%m/%d %H:%M:%S')
         except ValueError:
-            end_dt = None
-        start_dt = datetime.utcnow() if not start_dt else start_dt
-        end_dt = start_dt - timedelta(days=3) if not end_dt else end_dt
+            end_dt = start_dt - timedelta(days=3) if not end_dt else end_dt
         start = bson.ObjectId.from_datetime(start_dt)
         end = bson.ObjectId.from_datetime(end_dt)
         nb = M.Neighborhood.query.get(name='Users')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ef8c3397/Allura/allura/tests/functional/test_site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_site_admin.py b/Allura/allura/tests/functional/test_site_admin.py
index e0ba8fd..0f20247 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -16,7 +16,6 @@
 #       under the License.
 
 import json
-from datetime import timedelta
 
 from nose.tools import assert_equal
 from ming.odm import ThreadLocalORMSession


Mime
View raw message