diff --git a/django/contrib/humanize/templatetags/humanize.py b/django/contrib/humanize/templatetags/humanize.py
index 7a2e514..1398b43 100644
a
|
b
|
def naturaltime(value):
|
184 | 184 | if delta.days != 0: |
185 | 185 | return pgettext( |
186 | 186 | 'naturaltime', '%(delta)s ago' |
187 | | ) % {'delta': defaultfilters.timesince(value)} |
| 187 | ) % {'delta': defaultfilters.timesince(value, now)} |
188 | 188 | elif delta.seconds == 0: |
189 | 189 | return _('now') |
190 | 190 | elif delta.seconds < 60: |
… |
… |
def naturaltime(value):
|
206 | 206 | if delta.days != 0: |
207 | 207 | return pgettext( |
208 | 208 | 'naturaltime', '%(delta)s from now' |
209 | | ) % {'delta': defaultfilters.timeuntil(value)} |
| 209 | ) % {'delta': defaultfilters.timeuntil(value, now)} |
210 | 210 | elif delta.seconds == 0: |
211 | 211 | return _('now') |
212 | 212 | elif delta.seconds < 60: |
diff --git a/django/contrib/humanize/tests.py b/django/contrib/humanize/tests.py
index ecf4b83..a2b141e 100644
a
|
b
|
class HumanizeTests(TestCase):
|
130 | 130 | def utcoffset(self, dt): |
131 | 131 | return None |
132 | 132 | # we're going to mock datetime.datetime, so use a fixed datetime |
133 | | now = datetime.datetime(2011, 8, 15) |
| 133 | now = datetime.datetime(2011, 8, 15, 1, 23) |
134 | 134 | test_list = [ |
135 | 135 | now, |
136 | 136 | now - datetime.timedelta(seconds=1), |
… |
… |
class HumanizeTests(TestCase):
|
191 | 191 | orig_humanize_datetime = humanize.datetime |
192 | 192 | orig_timesince_datetime = timesince.datetime |
193 | 193 | humanize.datetime = MockDateTime |
194 | | timesince.datetime = new.module(b"mock_datetime") |
195 | | timesince.datetime.datetime = MockDateTime |
196 | 194 | |
197 | 195 | try: |
198 | 196 | self.humanize_tester(test_list, result_list, 'naturaltime') |