{{{
# django/tests/test_postgresql.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'django_tests',
},
'other': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'django_tests_other',
}
}
SECRET_KEY = "django_tests_secret_key"
# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
]
}}}
{{{
➜ tests git:(master) ✗ python runtests.py postgres_tests --settings
tests.test_postgresql
Testing against Django installed in
'/Users/aericson/projects/django/django' with up to 4 processes
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Cloning test database for alias 'default'...
Creating test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
Cloning test database for alias 'other'...
System check identified no issues (0 silenced).
.....................................................................................................................................x.........x...x.......x...............................................................................................................................FF.................................................................................
======================================================================
FAIL: test_non_exact_match (postgres_tests.test_search.SimpleSearchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 59, in testPartExecutor
yield
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 601, in run
testMethod()
File
"/Users/aericson/projects/django/tests/postgres_tests/test_search.py",
line 92, in test_non_exact_match
self.assertSequenceEqual(searched, [self.verse2])
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 1001, in assertSequenceEqual
self.fail(msg)
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 666, in fail
raise self.failureException(msg)
AssertionError: Sequences differ: <QuerySet []> != [<Line: His head
smashed in and his heart[115 chars] -->]
Second sequence contains 1 additional elements.
First extra element 0:
<Line: His head smashed in and his heart cut out, And his liver removed
and his bowels unplugged, And his nostrils ripped and his bottom burned
off,And his -->
- <QuerySet []>
+ [<Line: His head smashed in and his heart cut out, And his liver removed
and his bowels unplugged, And his nostrils ripped and his bottom burned
off,And his -->]
======================================================================
FAIL: test_search_two_terms (postgres_tests.test_search.SimpleSearchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 59, in testPartExecutor
yield
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 601, in run
testMethod()
File
"/Users/aericson/projects/django/tests/postgres_tests/test_search.py",
line 96, in test_search_two_terms
self.assertSequenceEqual(searched, [self.verse2])
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 1001, in assertSequenceEqual
self.fail(msg)
File
"/Users/aericson/.pyenv/versions/3.6.1/lib/python3.6/unittest/case.py",
line 666, in fail
raise self.failureException(msg)
AssertionError: Sequences differ: <QuerySet []> != [<Line: His head
smashed in and his heart[115 chars] -->]
Second sequence contains 1 additional elements.
First extra element 0:
<Line: His head smashed in and his heart cut out, And his liver removed
and his bowels unplugged, And his nostrils ripped and his bottom burned
off,And his -->
- <QuerySet []>
+ [<Line: His head smashed in and his heart cut out, And his liver removed
and his bowels unplugged, And his nostrils ripped and his bottom burned
off,And his -->]
----------------------------------------------------------------------
Ran 366 tests in 0.907s
FAILED (failures=2, expected failures=4)
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
Destroying test database for alias 'other'...
➜ tests git:(master) ✗
}}}
Please let me know if I can provide some more info.
I noticed Jenkins runs on 9.5, so I don't know if this problem is just for
me or everybody.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/28234>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* component: Uncategorized => contrib.postgres
Comment:
Tests are passing on PostgreSQL 9.6.3 for me (Ubuntu 14.04).
--
Ticket URL: <https://code.djangoproject.com/ticket/28234#comment:1>
Comment (by Florian Apolloner):
Might be related to the current locale settings of the db?
--
Ticket URL: <https://code.djangoproject.com/ticket/28234#comment:2>
* status: new => closed
* resolution: => invalid
Comment:
It does seem to be a locale problem.
Cleaned up everything (removed /usr/local/var/postgres), installed
postgres again with {{{ export LC_ALL=en_US.UTF-8; export LANG=en_US.UTF-8
}}} and it worked.
Thanks guys.
--
Ticket URL: <https://code.djangoproject.com/ticket/28234#comment:3>