Closed esc closed 10 years ago
Or am I doing it wrong?
I also tried using the instructions from:
https://docs.djangoproject.com/en/dev/topics/testing/overview/
zsh» python manage.py test
Could not import graphite.local_settings, using defaults!
/data/home/vhaenel/git-working/graphite-web/webapp/graphite/settings.py:217: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security
warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')
Creating test database for alias 'default'...
...............................................................F.................................................................F................s...........................................................................................................................x...................................................................................................................................
======================================================================
FAIL: testLoginRequired (django.contrib.auth.tests.decorators.LoginRequiredTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/home/vhaenel/virtualenv/graphite/local/lib/python2.7/site-packages/django/contrib/auth/tests/decorators.py", line 37, in testLoginRequired
self.assertTrue(login_url in response['Location'])
AssertionError: False is not true
======================================================================
FAIL: test_unknown_user (django.contrib.auth.tests.remote_user.RemoteUserNoCreateTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/home/vhaenel/virtualenv/graphite/local/lib/python2.7/site-packages/django/contrib/auth/tests/remote_user.py", line 145, in test_unknown_user
self.assertTrue(response.context['user'].is_anonymous())
AssertionError: False is not true
----------------------------------------------------------------------
Ran 402 tests in 4.264s
FAILED (failures=2, skipped=1, expected failures=1)
Destroying test database for alias 'default'...
And this looks fine at first sight, but when I add the following patch to check if the tests do actually run:
diff --git i/webapp/graphite/render/functions_test.py w/webapp/graphite/render/functions_test.py
index f57bda1371..8a054e271b 100644
--- i/webapp/graphite/render/functions_test.py
+++ w/webapp/graphite/render/functions_test.py
@@ -19,6 +19,9 @@ import graphite.render.functions as functions
class FunctionsTest(unittest.TestCase):
+ def testFaile(self):
+ self.assertFalse(True)
+
def testHighestMax(self):
config = [ 20, 50, 30, 40 ]
seriesList = [range(max_val) for max_val in config]
The failure is not reported, inidicating this does not actually run the tests...
I'll close this one myself now, since by now I have figured out how to run them.
FYI:
$ cd webapp
$ python manage.py test --settings=tests.settings
[...]