Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

turn off django paranoia for tests (bug 822760)

  • Loading branch information...
commit 084d22584cdb3b6c60002e2cebb9eec7f92a1337 1 parent a58bed2
@andymckay andymckay authored
View
10 lib/buyers/tests/test_api.py
@@ -1,5 +1,6 @@
import json
+from django_paranoia.signals import warning
import mock
from nose.tools import eq_
@@ -120,13 +121,14 @@ def test_patch_same_uuid(self):
eq_(res.status_code, 202)
eq_(obj.reget().uuid, self.uuid)
- @mock.patch('django_paranoia.reporters.cef_.log_cef')
- def test_paranoid_pin(self, log_cef):
- # A test of the paranoid form.
+ def test_paranoid_pin(self):
+ mthd = mock.Mock()
+ mthd.__name__ = 'mock_signal'
+ warning.connect(mthd, weak=False)
self.client.post(self.list_url, data={'uuid': self.uuid,
'pin': self.pin,
'foo': 'something naughty'})
- assert log_cef.called
+ assert mthd.called
class TestBuyerPaypal(APITest):
View
12 manage.py
@@ -23,13 +23,11 @@
manage.setup_environ(__file__, more_pythonic=True)
-# This isn't great, but it's evolving. Will move around hopefully.
-from django_paranoia import configure
-configure.config([
- 'django_paranoia.reporters.log',
- 'django_paranoia.reporters.cef_'
-])
-
if __name__ == "__main__":
manage.main()
+
+ # This isn't great, but it's evolving. Will move around hopefully.
+ from django.conf import settings
+ from django_paranoia import configure
+ configure.config(settings.DJANGO_PARANOIA_REPORTERS)
View
3  settings_test.py
@@ -34,3 +34,6 @@
# Send all statsd to nose.
STATSD_CLIENT = 'django_statsd.clients.nose'
+
+# No need for paranoia in tests.
+DJANGO_PARANOIA_REPORTERS = []
View
6 solitude/settings/base.py
@@ -180,3 +180,9 @@
CELERY_IMPORTS = ('lib.delayable.tasks',)
CELERY_RESULT_BACKEND = 'database'
CELERYD_HIJACK_ROOT_LOGGER = False
+
+# Paranoia levels.
+DJANGO_PARANOIA_REPORTERS = [
+ 'django_paranoia.reporters.log',
+ 'django_paranoia.reporters.cef_'
+]
Please sign in to comment.
Something went wrong with that request. Please try again.