Re: Problem with testing Django sources

16 views
Skip to first unread message

C. Kirby

unread,
Mar 11, 2013, 1:51:57 PM3/11/13
to django...@googlegroups.com
You didn't necessarily do anything wrong, if you mean you think you failed running the tests. The test ran and 4 of them are failing. It also looks like it missed 5 expected failures in among the 217 it skipped.

If your question is why are the tests failing - you might need to reword your question, and possibly make a question for each group of failing tests (the 4 failed tests belong to three separate django modules)
I will throw out that all of the failed tests look to be time related, and could be due to a number of factors, most often a mismatch between server and client, which in this case would be the time the test database thinks it is vs the time the request/response thinks it is vs the time python thinks it is.

Chaim

On Saturday, March 9, 2013 3:16:22 PM UTC-6, VVilku wrote:
Hello,
I have problem with testing Django sources from Git.

When I use:

PYTHONPATH=.. <path_to_python>/python runtests.py --settings=test_sqlite
(in Windows with Git Shell).

I receive these errors:

======================================================================
FAIL: test_naturalday_uses_localtime (django.contrib.humanize.tests.HumanizeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\- Repositories GIT -\django\django\contrib\humanize\tests.py", line 162, in test_naturalday_uses_localtime
    self.humanize_tester([dt], ['yesterday'], 'naturalday')
  File "D:\- Repositories GIT -\django\django\contrib\humanize\tests.py", line 48, in humanize_tester
    msg="%s test failed, produced '%s', should've produced '%s'" % (method, rendered, result))
AssertionError: naturalday test failed, produced 'today', should've produced 'yesterday'

======================================================================
FAIL: test_aware_expiration (requests.tests.RequestsTests)
Cookie accepts an aware datetime as expiration time
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\- Repositories GIT -\django\tests\requests\tests.py", line 275, in test_aware_expiration
    self.assertEqual(datetime_cookie['max-age'], 10)
AssertionError: 11 != 10

======================================================================
FAIL: test_near_expiration (requests.tests.RequestsTests)
Cookie will expire when an near expiration time is provided
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\- Repositories GIT -\django\tests\requests\tests.py", line 266, in test_near_expiration
    self.assertEqual(datetime_cookie['max-age'], 10)
AssertionError: 11 != 10

======================================================================
FAIL: test_feed_last_modified_time (syndication.tests.SyndicationFeedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\- Repositories GIT -\django\tests\syndication\tests.py", line 265, in test_feed_last_modified_time
    self.assertEqual(response['Last-Modified'], 'Thu, 03 Jan 2008 19:30:00 GMT')
AssertionError: 'Thu, 03 Jan 2008 12:30:00 GMT' != u'Thu, 03 Jan 2008 19:30:00 GMT'

----------------------------------------------------------------------
Ran 5124 tests in 2268.805s

FAILED (failures=4, skipped=217, expected failures=9)


Does anyone know what I'm doing wrong?
regards,
VVilku
Reply all
Reply to author
Forward
0 new messages