Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
902b0321
Commit
902b0321
authored
Oct 30, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use timezone aware timestamps in tests
Issue #892 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
d0a6fd1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
weblate/trans/tests/test_naturaldate.py
weblate/trans/tests/test_naturaldate.py
+2
-1
weblate/trans/tests/test_vcs.py
weblate/trans/tests/test_vcs.py
+3
-3
No files found.
weblate/trans/tests/test_naturaldate.py
View file @
902b0321
...
...
@@ -24,6 +24,7 @@ Testing of natural time conversion.
from
unittest
import
TestCase
from
weblate.trans.templatetags.translations
import
naturaltime
import
datetime
from
django.utils
import
timezone
TEST_DATA
=
(
(
0
,
'now'
),
...
...
@@ -60,7 +61,7 @@ TEST_DATA = (
class
NaturalTimeTest
(
TestCase
):
def
test_natural
(
self
):
now
=
datetime
.
datetim
e
.
now
()
now
=
timezon
e
.
now
()
for
diff
,
expected
in
TEST_DATA
:
testdate
=
now
+
datetime
.
timedelta
(
seconds
=
diff
)
result
=
naturaltime
(
testdate
,
now
)
...
...
weblate/trans/tests/test_vcs.py
View file @
902b0321
...
...
@@ -27,7 +27,7 @@ from django.test import TestCase
import
tempfile
import
shutil
import
os.path
import
datetim
e
from
django.utils
import
timezon
e
class
GithubFakeRepository
(
GithubRepository
):
...
...
@@ -116,7 +116,7 @@ class VCSGitTest(RepoTestCase):
repo
.
commit
(
'Test commit'
,
'Foo Bar <foo@bar.com>'
,
datetime
.
datetim
e
.
now
(),
timezon
e
.
now
(),
[
filename
]
)
...
...
@@ -290,7 +290,7 @@ class VCSGitTest(RepoTestCase):
self
.
repo
.
commit
(
'Test commit'
,
'Foo Bar <foo@bar.com>'
,
datetime
.
datetim
e
.
now
(),
timezon
e
.
now
(),
[
'testfile'
]
)
# Check we have new revision
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment