From f0c3def93529d9ae3deb806967678645898b6414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michele=20Orr=C3=B9?= Date: Sat, 11 Feb 2017 15:47:31 +0100 Subject: [PATCH] Make the test really works. This fixes the proble with debug_toolbar, the fucking toolbar that messes all your tests. --- gestioCOF/urls.py | 2 +- gestion/tests.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gestioCOF/urls.py b/gestioCOF/urls.py index d786e497..c76337a2 100644 --- a/gestioCOF/urls.py +++ b/gestioCOF/urls.py @@ -88,7 +88,7 @@ urlpatterns = [ url(r'^k-fet/', include('kfet.urls')), ] -if settings.DEBUG: +if 'debug_toolbar' in settings.INSTALLED_APPS: import debug_toolbar urlpatterns += [ url(r'^__debug__/', include(debug_toolbar.urls)), diff --git a/gestion/tests.py b/gestion/tests.py index 49f5736e..2e244271 100644 --- a/gestion/tests.py +++ b/gestion/tests.py @@ -68,4 +68,5 @@ class TestProfile(TestCase): root = User.objects.create_superuser('root', 'foo@bar.com', 'root') c = Client() c.login(username='root', password='root') - c.get('/k-fet') + response = c.get('/') + self.assertEqual(response.status_code, 200)