Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit cdaf8f5

Browse files
committed
Move tests out the applicaton package.
1 parent 3ac74e7 commit cdaf8f5

File tree

6 files changed

+11
-21
lines changed

6 files changed

+11
-21
lines changed
File renamed without changes.
File renamed without changes.
Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
SECRET_KEY = 'dripdripdripdripdripdripdrip'
2-
3-
# MUST SPECIFY TO MAKE USE OF DJANGO DRIP
4-
DRIP_FROM_EMAIL = ''
5-
DEBUG = True
6-
7-
SECRET_KEY = 'whatever/you/want-goes-here'
8-
91
SECRET_KEY="whatever"
102

113
DATABASES = {
124
'default': {
135
'ENGINE': 'django.db.backends.sqlite3',
14-
'NAME': 'sqlite.db',
156
},
167
}
178

@@ -21,11 +12,8 @@
2112
'django.contrib.sessions',
2213
'django.contrib.contenttypes',
2314
'django.contrib.staticfiles',
24-
2515
'drip',
26-
27-
# testing only
28-
'credits',
16+
'tests',
2917
)
3018

3119
MIDDLEWARE_CLASSES = (
@@ -40,9 +28,11 @@
4028
USE_TZ = True
4129
TIME_ZONE = 'UTC'
4230

43-
AUTH_PROFILE_MODULE = 'credits.Profile'
31+
AUTH_PROFILE_MODULE = 'tests.Profile'
4432

45-
ROOT_URLCONF = 'test_urls'
33+
ROOT_URLCONF = 'tests.urls'
4634

4735
STATIC_URL = '/static/'
4836
STATICFILES_DIRS = ()
37+
38+
DRIP_FROM_EMAIL = ''

drip/tests.py renamed to tests/tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from datetime import datetime, timedelta
1+
from datetime import timedelta
22

33
from django.test import TestCase
44
from django.test.client import RequestFactory
@@ -12,7 +12,7 @@
1212
from drip.drips import DripBase, DripMessage
1313
from drip.utils import get_user_model, unicode
1414

15-
from credits.models import Profile
15+
from .models import Profile
1616

1717

1818
class RulesTestCase(TestCase):
@@ -452,7 +452,7 @@ def test_default_email(self):
452452
self.assertIsInstance(email, mail.EmailMultiAlternatives)
453453

454454
def test_custom_added_not_used(self):
455-
settings.DRIP_MESSAGE_CLASSES = {'plain': 'drip.tests.PlainDripEmail'}
455+
settings.DRIP_MESSAGE_CLASSES = {'plain': '%s.PlainDripEmail' % __name__}
456456
result = self.model_drip.drip.send()
457457
self.assertEqual(1, result)
458458
self.assertEqual(1, len(mail.outbox))
@@ -461,7 +461,7 @@ def test_custom_added_not_used(self):
461461
self.assertIsInstance(email, mail.EmailMultiAlternatives)
462462

463463
def test_custom_added_and_used(self):
464-
settings.DRIP_MESSAGE_CLASSES = {'plain': 'drip.tests.PlainDripEmail'}
464+
settings.DRIP_MESSAGE_CLASSES = {'plain': '%s.PlainDripEmail' % __name__}
465465
self.model_drip.message_class = 'plain'
466466
self.model_drip.save()
467467
result = self.model_drip.drip.send()
@@ -472,7 +472,7 @@ def test_custom_added_and_used(self):
472472
self.assertIsInstance(email, mail.EmailMessage)
473473

474474
def test_override_default(self):
475-
settings.DRIP_MESSAGE_CLASSES = {'default': 'drip.tests.PlainDripEmail'}
475+
settings.DRIP_MESSAGE_CLASSES = {'default': '%s.PlainDripEmail' % __name__}
476476
result = self.model_drip.drip.send()
477477
self.assertEqual(1, result)
478478
self.assertEqual(1, len(mail.outbox))
File renamed without changes.

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ basepython =
1212
py34: python3.4
1313
usedevelop = true
1414
commands =
15-
{envpython} -R -Wonce {envbindir}/django-admin.py test -v2 --settings=testsettings drip
15+
{envpython} -R -Wonce {envbindir}/django-admin.py test -v2 --settings=tests.settings tests
1616
deps =
1717
django-timedeltafield==0.7.2
1818
1.4: Django>=1.4,<1.5

0 commit comments

Comments
 (0)