A test project that reproduces the problem would be helpful.
On Tuesday, October 27, 2015 at 9:14:13 AM UTC-4, Christopher R. wrote:
-- On Tuesday, October 27, 2015 at 9:14:13 AM UTC-4, Christopher R. wrote:
Have you been able to fix the problem? I am encountering the same issue on both Django 1.8.4 and 1.8.5.
Any help would be appreciated.
On Thursday, October 8, 2015 at 3:38:16 PM UTC+1, thinkwell wrote:I could use some assistance in troubleshooting a psycopg2.InterfaceError problem that has erratic behavior. Here is the test module suite that I'm running to test these models, and in this state all the tests in the module pass. However, it's extremely easy to trigger a psycopg2.InterfaceError, although not relating to the lines changed. For example, if I change:...
class TestSilly(SimpleTestCase):
def test_is_not_false(self):
self.assertTrue(False is not True)
to
class TestSilly(TestCase):
def test_is_not_false(self):
self.assertTrue(False is not True)
Then this error is raised, but referencing TestPolicyModel instead of TestSilly!
============================================================ ==========
ERROR: test_toggle_autofix (accounts.tests.test_models.TestPolicyModel )
------------------------------------------------------------ ----------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 137, in _cursorbackends/base/base.py"
return self.create_cursor()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 212, in create_cursorbackends/postgresql_psycopg2/ base.py"
cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "apps/accounts/tests/test_models.py" , line 174, in test_toggle_autofix
p = Policy.objects.first()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 127, in manager_methodmodels/manager.py"
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 490, in firstmodels/query.py"
objects = list((self if self.ordered else self.order_by('pk'))[:1])
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 162, in __iter__models/query.py"
self._fetch_all()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 965, in _fetch_allmodels/query.py"
self._result_cache = list(self.iterator())
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 238, in iteratormodels/query.py"
results = compiler.execute_sql()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 838, in execute_sqlmodels/sql/compiler.py"
cursor = self.connection.cursor()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 164, in cursorbackends/base/base.py"
cursor = self.make_cursor(self._cursor())
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 137, in _cursorbackends/base/base.py"
return self.create_cursor()
File "/usr/local/lib/python3.4/dist-packages/django/db/utils. , line 97, in __exit__py"
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/usr/local/lib/python3.4/dist-packages/django/utils/ , line 658, in reraisesix.py"
raise value.with_traceback(tb)
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 137, in _cursorbackends/base/base.py"
return self.create_cursor()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 212, in create_cursorbackends/postgresql_psycopg2/ base.py"
cursor = self.connection.cursor()
django.db.utils.InterfaceError: connection already closed
For another example, if I change
TestPolicyModel(TestCase)
to
TestPolicyModel(SimpleTestCase)
then, I get the following error regarding TestRedwoodModel
============================================================ ==========
ERROR: setUpClass (accounts.tests.test_models.TestRedwoodModel )
------------------------------------------------------------ ----------
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 137, in _cursorbackends/base/base.py"
return self.create_cursor()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 212, in create_cursorbackends/postgresql_psycopg2/ base.py"
cursor = self.connection.cursor()
psycopg2.InterfaceError: connection already closed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "apps/accounts/tests/test_models.py" , line 195, in setUpClass
cls.ru = RedwoodUsers.objects.first()
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 127, in manager_methodmodels/manager.py"
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/django/db/ , line 490, in firstmodels/query.py"
objects = list((self if self.ordered else self.order_by(
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f3075d88-f670-4dca-b413-5b4d6a20d78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment