#27160: Improve `Unit tests` section in `Contributing to Django`
--------------------------------------+--------------------
     Reporter:  pacahon               |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Documentation         |    Version:  1.9
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 I'm talking about
 [https://docs.djangoproject.com/en/1.9/internals/contributing/writing-code
 /unit-tests/#using-another-settings-module Using another settings module]
 subsection.

 Django system tests freezes on my machine with default settings (sqlite),
 so I decided to try `postgresql` as backend.
 I created user with CREATEDB permissions and replaced DB settings with

 {{{
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.postgresql_psycopg2',
         'USER': 'test',
         'PASSWORD': 'test',
         'HOST': 'localhost',
         'NAME': 'test_d'
     },
     'other': {
         'ENGINE': 'django.db.backends.postgresql_psycopg2',
         'USER': 'test',
         'PASSWORD': 'test',
         'HOST': 'localhost',
         'NAME': 'test_o',
     }
 }
 }}}

 After that I got an error:

 {{{
 django.db.utils.OperationalError: FATAL:  database "test_d" does not exist
 }}}

 When docs says:
 {{{
 Test databases get their names by prepending test_ to the value of the
 NAME settings for the databases defined in DATABASES. These test databases
 are deleted when the tests are finished.
 }}}
 I'm waiting that `runtests` will create `test_test_o` and `test_test_d`
 for me and I no need in `test_d` and `test_o` databases at all.

 Maybe I'm doing something wrong or docs should be improved?

 P.S. After I created dbs manually, I got:

 {{{
 psycopg2.ProgrammingError: permission denied to create extension "hstore".
 HINT:  Must be superuser to create this extension.
 }}}

 Mb it's engine specific error, I'm not sure.

--
Ticket URL: <https://code.djangoproject.com/ticket/27160>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.e72328c74b82246056762cc505c7e6b3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to