aboutsummaryrefslogtreecommitdiffstats
path: root/brevisurl/tests/test_models.py
diff options
context:
space:
mode:
authorVladimir Gorej2012-06-20 20:49:43 +0200
committerVladimir Gorej2012-06-20 20:49:43 +0200
commit178d820541e874fe9913080c5125876b9c0b82ca (patch)
tree9253fc8b190c7e9e957d55ebf7de28609a06c276 /brevisurl/tests/test_models.py
parent395fa7a203aba58e24362f55a6997f2fc82deb2a (diff)
downloaddjango-brevisurl-178d820541e874fe9913080c5125876b9c0b82ca.tar.bz2
Issue #5; Configure protocol of local backend via settings
Diffstat (limited to 'brevisurl/tests/test_models.py')
-rw-r--r--brevisurl/tests/test_models.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/brevisurl/tests/test_models.py b/brevisurl/tests/test_models.py
index 6942124..9a843f1 100644
--- a/brevisurl/tests/test_models.py
+++ b/brevisurl/tests/test_models.py
@@ -2,6 +2,7 @@ from django.core.exceptions import ValidationError
from django.test import TestCase
from django.contrib.sites.models import Site
+import brevisurl.settings
from brevisurl.models import ShortUrl
from brevisurl import get_connection
@@ -13,7 +14,8 @@ class TestModels(TestCase):
connection = get_connection('brevisurl.backends.local.BrevisUrlBackend')
short_url = ShortUrl()
short_url.original_url = 'http://www.codescale.net/'
- short_url.shortened_url = '{0}://{1}/12345'.format(connection.PROTOCOL, site.domain)
+ short_url.shortened_url = '{0}://{1}/12345'.format(brevisurl.settings.LOCAL_BACKEND_DOMAIN_PROTOCOL,
+ site.domain)
short_url.backend = connection.class_path
short_url.save()
self.assertIsNotNone(short_url.pk)
@@ -24,7 +26,8 @@ class TestModels(TestCase):
self.connection = get_connection('brevisurl.backends.local.BrevisUrlBackend')
self.short_url = ShortUrl()
self.short_url.original_url = 'www.codescale.'
- self.short_url.shortened_url = '{0}://{1}/12345'.format(self.connection.PROTOCOL, self.site.domain)
+ self.short_url.shortened_url = '{0}://{1}/12345'.format(brevisurl.settings.LOCAL_BACKEND_DOMAIN_PROTOCOL,
+ self.site.domain)
self.short_url.backend = self.connection.class_path
self.short_url.save()