You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/10 22:44:47 UTC

[allura] 16/41: [#8349] remove leading 0 numbers that are not really octal

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8349
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 390dbf2c56294a697794a8628ee328a75de66c4e
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Feb 10 14:10:46 2020 -0500

    [#8349] remove leading 0 numbers that are not really octal
---
 Allura/allura/tests/test_helpers.py                 | 2 +-
 Allura/allura/tests/test_plugin.py                  | 2 +-
 Allura/allura/tests/test_utils.py                   | 2 +-
 Allura/allura/tests/test_webhooks.py                | 2 +-
 Allura/allura/tests/unit/test_ldap_auth_provider.py | 2 +-
 ForgeUserStats/forgeuserstats/tests/test_model.py   | 8 ++++----
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Allura/allura/tests/test_helpers.py b/Allura/allura/tests/test_helpers.py
index 97e7dac..ecb265c 100644
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -319,7 +319,7 @@ def test_inject_user(context):
 
 def test_datetimeformat():
     from datetime import date
-    assert h.datetimeformat(date(2013, 01, 01)) == '2013-01-01 00:00:00'
+    assert h.datetimeformat(date(2013, 1, 1)) == '2013-01-01 00:00:00'
 
 
 def test_nl2br_jinja_filter():
diff --git a/Allura/allura/tests/test_plugin.py b/Allura/allura/tests/test_plugin.py
index 83c865f..8e02010 100644
--- a/Allura/allura/tests/test_plugin.py
+++ b/Allura/allura/tests/test_plugin.py
@@ -632,7 +632,7 @@ class TestLocalAuthenticationProvider(object):
 
     def test_get_last_password_updated(self):
         user = Mock()
-        user.last_password_updated = dt.datetime(2014, 06, 04, 13, 13, 13)
+        user.last_password_updated = dt.datetime(2014, 6, 4, 13, 13, 13)
         upd = self.provider.get_last_password_updated(user)
         assert_equal(upd, user.last_password_updated)
 
diff --git a/Allura/allura/tests/test_utils.py b/Allura/allura/tests/test_utils.py
index c34e7c0..675886c 100644
--- a/Allura/allura/tests/test_utils.py
+++ b/Allura/allura/tests/test_utils.py
@@ -345,7 +345,7 @@ def test_empty_cursor():
 
 def test_DateJSONEncoder():
     data = {'message': 'Hi!',
-            'date': dt.datetime(2015, 01, 30, 13, 13, 13)}
+            'date': dt.datetime(2015, 1, 30, 13, 13, 13)}
     result = json.dumps(data, cls=utils.DateJSONEncoder)
     assert_equal(result, '{"date": "2015-01-30T13:13:13Z", "message": "Hi!"}')
 
diff --git a/Allura/allura/tests/test_webhooks.py b/Allura/allura/tests/test_webhooks.py
index adba095..a7e1b8f 100644
--- a/Allura/allura/tests/test_webhooks.py
+++ b/Allura/allura/tests/test_webhooks.py
@@ -652,7 +652,7 @@ class TestModels(TestWebhookBase):
 
     @patch('allura.model.webhook.dt', autospec=True)
     def test_update_limit(self, dt_mock):
-        _now = dt.datetime(2015, 02, 02, 13, 39)
+        _now = dt.datetime(2015, 2, 2, 13, 39)
         dt_mock.datetime.utcnow.return_value = _now
         assert_equal(self.wh.last_sent, None)
         self.wh.update_limit()
diff --git a/Allura/allura/tests/unit/test_ldap_auth_provider.py b/Allura/allura/tests/unit/test_ldap_auth_provider.py
index 5945581..1896e5e 100644
--- a/Allura/allura/tests/unit/test_ldap_auth_provider.py
+++ b/Allura/allura/tests/unit/test_ldap_auth_provider.py
@@ -155,6 +155,6 @@ class TestLdapAuthenticationProvider(object):
 
     def test_get_last_password_updated(self):
         user = Mock()
-        user.last_password_updated = datetime(2014, 06, 04, 13, 13, 13)
+        user.last_password_updated = datetime(2014, 6, 4, 13, 13, 13)
         upd = self.provider.get_last_password_updated(user)
         assert_equal(upd, user.last_password_updated)
diff --git a/ForgeUserStats/forgeuserstats/tests/test_model.py b/ForgeUserStats/forgeuserstats/tests/test_model.py
index afa94a1..308728e 100644
--- a/ForgeUserStats/forgeuserstats/tests/test_model.py
+++ b/ForgeUserStats/forgeuserstats/tests/test_model.py
@@ -443,12 +443,12 @@ class TestUserStats(unittest.TestCase):
                    login_datetime) < timedelta(seconds=1)
 
     def test_start_date(self):
-        stats = USM.UserStats(registration_date=datetime(2012, 04, 01))
-        self.assertEqual(stats.start_date, datetime(2012, 04, 01))
+        stats = USM.UserStats(registration_date=datetime(2012, 4, 1))
+        self.assertEqual(stats.start_date, datetime(2012, 4, 1))
         with h.push_config(config, **{'userstats.start_date': '2013-04-01'}):
-            self.assertEqual(stats.start_date, datetime(2013, 04, 01))
+            self.assertEqual(stats.start_date, datetime(2013, 4, 1))
         with h.push_config(config, **{'userstats.start_date': '2011-04-01'}):
-            self.assertEqual(stats.start_date, datetime(2012, 04, 01))
+            self.assertEqual(stats.start_date, datetime(2012, 4, 1))
 
     @mock.patch('allura.model.stats.difflib.unified_diff')
     def test_count_loc(self, unified_diff):