Skip to content

Commit 233df5d

Browse files
author
Kenneth Reitz
committed
fix tests
1 parent 3757960 commit 233df5d

File tree

15 files changed

+2
-255
lines changed

15 files changed

+2
-255
lines changed

bin/steps/django

+2-38
Original file line numberDiff line numberDiff line change
@@ -21,50 +21,14 @@ fi
2121
echo "-----> Injecting Django settings..."
2222

2323

24-
SETTINGS_FILE=$(find . -maxdepth 3 -type f -name 'settings.py' | head -1)
24+
SETTINGS_FILE=$(find . -maxdepth 2 -type f -name 'settings.py' | head -1)
2525
PROJECT=$(dirname $SETTINGS_FILE)
2626

2727
echo "Injecting code into $SETTINGS_FILE to read from DATABASE_URL" | indent
2828

2929
cat >>$SETTINGS_FILE <<EOF
3030
31-
import os
32-
import sys
33-
import urlparse
34-
35-
# Register database schemes in URLs.
36-
urlparse.uses_netloc.append('postgres')
37-
urlparse.uses_netloc.append('mysql')
38-
39-
try:
40-
41-
# Check to make sure DATABASES is set in settings.py file.
42-
# If not default to {}
43-
44-
if 'DATABASES' not in locals():
45-
DATABASES = {}
46-
47-
if 'DATABASE_URL' in os.environ:
48-
url = urlparse.urlparse(os.environ['DATABASE_URL'])
49-
50-
# Ensure default database exists.
51-
DATABASES['default'] = DATABASES.get('default', {})
52-
53-
# Update with environment configuration.
54-
DATABASES['default'].update({
55-
'NAME': url.path[1:],
56-
'USER': url.username,
57-
'PASSWORD': url.password,
58-
'HOST': url.hostname,
59-
'PORT': url.port,
60-
})
61-
if url.scheme == 'postgres':
62-
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
63-
64-
if url.scheme == 'mysql':
65-
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
66-
except Exception:
67-
print 'Unexpected error:', sys.exc_info()
31+
import dj_database_url
6832
6933
EOF
7034

bin/test

-6
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ testDetectNotPython() {
5656
assertEquals "1" "${RETURN}"
5757
}
5858

59-
testDetectDjangoWithMultipleRequirements() {
60-
detect "multiple-requirements"
61-
assertCapturedEquals "Python/Django"
62-
assertCapturedSuccess
63-
}
64-
6559

6660
## utils ########################################
6761

6 KB
Binary file not shown.

test/multiple-requirements/haystack/haystack/__init__.py

Whitespace-only changes.

test/multiple-requirements/haystack/haystack/settings.py

-154
This file was deleted.

test/multiple-requirements/haystack/haystack/urls.py

-17
This file was deleted.

test/multiple-requirements/haystack/haystack/wsgi.py

-28
This file was deleted.

test/multiple-requirements/haystack/manage.py

-10
This file was deleted.

test/multiple-requirements/haystack/requirements.txt

-1
This file was deleted.

test/multiple-requirements/requirements.txt

-1
This file was deleted.

0 commit comments

Comments
 (0)