Permalink
Browse files

Replacing 'conf' module with 'settings' module.

  • Loading branch information...
1 parent c90b499 commit e9f8d021c31a9169e32b01f1abded568ec209b54 Randall Degges committed Mar 19, 2012
Showing with 33 additions and 33 deletions.
  1. +1 −1 django_twilio/tests/client.py
  2. +10 −10 django_twilio/tests/decorators.py
  3. +22 −22 django_twilio/tests/views.py
View
2 django_twilio/tests/client.py
@@ -3,7 +3,7 @@
from twilio.rest import TwilioRestClient
from django_twilio.client import twilio_client
-from django_twilio.conf import TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN
+from django_twilio.settings import TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN
class TwilioClientTestCase(TestCase):
View
20 django_twilio/tests/decorators.py
@@ -8,7 +8,7 @@
from twilio.twiml import Response
-from django_twilio import conf
+from django_twilio import settings as django_twilio_settings
from django_twilio.tests.views import response_view, str_view, verb_view
@@ -28,23 +28,23 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ django_twilio_settings.TWILIO_ACCOUNT_SID = 'xxx'
+ django_twilio_settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate Twilio signatures for our test views.
- self.response_signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.response_signature = encodestring(new(django_twilio_settings.TWILIO_AUTH_TOKEN,
'%s/response_view/' % self.uri, sha1).digest()).strip()
- self.str_signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.str_signature = encodestring(new(django_twilio_settings.TWILIO_AUTH_TOKEN,
'%s/str_view/' % self.uri, sha1).digest()).strip()
self.str_signature_with_from_field_normal_caller = encodestring(new(
- conf.TWILIO_AUTH_TOKEN,
+ django_twilio_settings.TWILIO_AUTH_TOKEN,
'%s/str_view/From+12222222222' % self.uri,
sha1).digest()).strip()
self.str_signature_with_from_field_blacklisted_caller = encodestring(
- new(conf.TWILIO_AUTH_TOKEN,
+ new(django_twilio_settings.TWILIO_AUTH_TOKEN,
'%s/str_view/From+13333333333' % self.uri,
sha1).digest()).strip()
- self.verb_signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.verb_signature = encodestring(new(django_twilio_settings.TWILIO_AUTH_TOKEN,
'%s/verb_view/' % self.uri, sha1).digest()).strip()
def test_is_csrf_exempt(self):
@@ -74,8 +74,8 @@ def test_decorator_preserves_metadata(self):
self.assertEqual(str_view.__name__, 'str_view')
def test_missing_settings_return_forbidden(self):
- del conf.TWILIO_ACCOUNT_SID
- del conf.TWILIO_AUTH_TOKEN
+ del django_twilio_settings.TWILIO_ACCOUNT_SID
+ del django_twilio_settings.TWILIO_AUTH_TOKEN
debug_orig = settings.DEBUG
settings.DEBUG = False
self.assertEquals(self.client.post(self.str_uri).status_code, 403)
View
44 django_twilio/tests/views.py
@@ -6,7 +6,7 @@
from django.test import Client, RequestFactory, TestCase
from twilio.twiml import Response
-from django_twilio import conf
+from django_twilio import settings
from django_twilio.decorators import twilio_view
from django_twilio.views import conference, dial, gather, play, record, say, \
sms
@@ -45,11 +45,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate Twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/say/' % self.uri, sha1).digest()).strip()
def test_say_no_text(self):
@@ -73,11 +73,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/play/' % self.uri, sha1).digest()).strip()
def test_play_no_url(self):
@@ -101,11 +101,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/gather/' % self.uri, sha1).digest()).strip()
def test_gather(self):
@@ -125,11 +125,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/record/' % self.uri, sha1).digest()).strip()
def test_record(self):
@@ -149,11 +149,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/sms/' % self.uri, sha1).digest()).strip()
def test_sms_no_message(self):
@@ -177,11 +177,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/dial/' % self.uri, sha1).digest()).strip()
def test_dial_no_number(self):
@@ -205,11 +205,11 @@ def setUp(self):
# Guarantee a value for the required configuration settings after each
# test case.
- conf.TWILIO_ACCOUNT_SID = 'xxx'
- conf.TWILIO_AUTH_TOKEN = 'xxx'
+ settings.TWILIO_ACCOUNT_SID = 'xxx'
+ settings.TWILIO_AUTH_TOKEN = 'xxx'
# Pre-calculate twilio signatures for our test views.
- self.signature = encodestring(new(conf.TWILIO_AUTH_TOKEN,
+ self.signature = encodestring(new(settings.TWILIO_AUTH_TOKEN,
'%s/conference/' % self.uri, sha1).digest()).strip()
def test_conference_no_name(self):

0 comments on commit e9f8d02

Please sign in to comment.