Code

Opened 7 years ago

Closed 7 years ago

#4226 closed (fixed)

Running Django unit tests requires DATABASE_NAME setting despite what the docs. say

Reported by: Paul Smith <paulsmith@…> Owned by: jacob
Component: Documentation Version: master
Severity: Keywords: contributing database_name settings
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The 'Contributing to Django' docs say that DATABASE_ENGINE , DATABASE_USER , and DATABASE_PASSWORD settings are required to running Django's unit tests, but DATABASE_NAME is also required.

$ ./runtests.py --settings=settings
Traceback (most recent call last):
  File "./runtests.py", line 154, in <module>
    django_tests(int(options.verbosity), args)
  File "./runtests.py", line 127, in django_tests
    failures = run_tests(test_models, verbosity, extra_tests=extra_tests)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/test/simple.py", line 81, in run_tests
    create_test_db(verbosity)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/test/utils.py", line 62, in create_test_db
    cursor = connection.cursor()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/django/db/backends/postgresql/base.py", line 71, in cursor
    raise ImproperlyConfigured, "You need to specify DATABASE_NAME in your Django settings file."  
django.core.exceptions.ImproperlyConfigured: You need to specify DATABASE_NAME in your Django settings file.

Attachments (1)

contributing_db_name.diff (1.0 KB) - added by Paul Smith <paulsmith@…> 7 years ago.
Added DATABASE_NAME to section on running unit tests

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Paul Smith <paulsmith@…>

Added DATABASE_NAME to section on running unit tests

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from [patch] Running Django unit tests requires DATABASE_NAME setting to Running Django unit tests requires DATABASE_NAME setting despite what the docs. say
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [5160]) Fixed #4226 -- Added DATABASE_NAME to the list of settings required to be
mentioned in the settings file for the tests to run. Thanks, Paul Smith.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.