So, I hg pull; hg update and reran the Python3 tests. The Egg import test
passes now.
The attached patch fix makes the last 2 tests pass in both 2.7.2 and 3.2.1
under postgres and sqlite. I'll be honest and say I don't know why, so
please figure out why and explain it to me. I think it's because psycopg2
won't run upper on something that's not a unicode in python 3, but it needs
to be a bytestring later to have the "buffer interface" implemented.
On Tue, Dec 6, 2011 at 9:05 PM, Joe & Anne Tennies <[email protected]>wrote:
> Updated:
>
> I thought I'd put in my timing numbers on my computer (F16 on a Phenom II
>> x6):
>>
>> Python3 port on python 3.2.1 w/ sqlite:
>> * Ran 4429 tests in 528.327s
>> * FAILED (errors=1, skipped=96, expected failures=2, unexpected
>> successes=1) +
>> Python3 port on python 2.7.2 w/ sqlite:
>> * Ran 4490 tests in 487.212s
>> * OK (skipped=82, expected failures=3)
>> Django trunk (bitbucket mirror) on python 2.7.2 w/ sqlite:
>> * Ran 4495 tests in 472.527s
>> * OK (skipped=82, expected failures=3)
>>
>
> Python3 port on python 3.2.1 w/ psycopg2:
> * Ran 4429 tests in 3102.890s
> *FAILED (errors=3, skipped=75, expected failures=2, unexpected
> successes=1) ++
> Python3 port on python 2.7.2 w/ psycopg2:
> * Ran 4490 tests in 3086.170s
> * OK (skipped=61, expected failures=3)
> Django trunk (bitbucket mirror) on python 2.7.2 w/ psycopg2:
> * Ran 4495 tests in 3316.408s
> * OK (skipped=61, expected failures=3)
>
>>
>>
>>
>>
>> All versions were grabbed around 11pm CST on 5 December 2011. The numbers
>> were grabbed with a generally unused computer except for the tests (mostly
>> just me browsing the web while I get bored waiting for tests to finish
>> running). These are all single runs while I "putz" on my computer. I
>> wouldn't count them for exacting numbers, but they should be good for
>> finding order of magnitude problems. All tests are run w/ a command like
>> "PYTHONPATH=..:$PYTHONPATH python ./runtests.py --settings=test_postgres"
>> using the system packages from Fedora 16.
>>
>> Also, I had pypy 1.6 (from yum) installed. It would not run either trunk
>> or the port. Not sure of the problem.
>>
>>
>> +) ERROR: test_existing (regressiontests.templates.loaders.EggLoaderTest)
>>
>> A template can be loaded from an egg
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File
>> "/home/joe/Projects/django2-3/django/tests/regressiontests/templates/loaders.py",
>> line 88, in test_existing
>>
>> contents, template_name = egg_loader.load_template_source("y.html")
>> File
>> "/home/joe/Projects/django2-3/django/django/template/loaders/eggs.py", line
>> 28, in load_template_source
>> raise TemplateDoesNotExist(template_name)
>> django.template.base.TemplateDoesNotExist: y.html
>>
>>
>>
>> ++) ERROR: test_recentactions_without_content_type
>> (regressiontests.admin_views.tests.AdminViewStringPrimaryKeyTest)
>> If a LogEntry is missing content_type it will not display it in span tag
>> under the hyperlink.
>>
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File
>> "/home/joe/Projects/django2-3/django/django/db/backends/postgresql_psycopg2/base.py",
>> line 54, in execute
>> return self.cursor.execute(query, args)
>> psycopg2.ProgrammingError: function upper(bytea) does not exist
>> LINE 1: ...WHERE UPPER("django_content_type"."name"::text) = UPPER('\x4...
>> ^
>> HINT: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>>
>>
>> During handling of the above exception, another exception occurred:
>>
>>
>> Traceback (most recent call last):
>> File
>> "/home/joe/Projects/django2-3/django/tests/regressiontests/admin_views/tests.py",
>> line 1261, in test_recentactions_without_content_type
>> logentry =
>> LogEntry.objects.get(content_type__name__iexact=should_contain)
>> File "/home/joe/Projects/django2-3/django/django/db/models/manager.py",
>> line 131, in get
>> return self.get_query_set().get(*args, **kwargs)
>> File "/home/joe/Projects/django2-3/django/django/db/models/query.py",
>> line 361, in get
>> num = len(clone)
>> File "/home/joe/Projects/django2-3/django/django/db/models/query.py",
>> line 86, in __len__
>> self._result_cache = list(self.iterator())
>> File "/home/joe/Projects/django2-3/django/django/db/models/query.py",
>> line 293, in iterator
>> for row in compiler.results_iter():
>> File
>> "/home/joe/Projects/django2-3/django/django/db/models/sql/compiler.py",
>> line 699, in results_iter
>> for rows in self.execute_sql(MULTI):
>> File
>> "/home/joe/Projects/django2-3/django/django/db/models/sql/compiler.py",
>> line 754, in execute_sql
>> cursor.execute(sql, params)
>> File
>> "/home/joe/Projects/django2-3/django/django/db/backends/postgresql_psycopg2/base.py",
>> line 60, in execute
>> reraise(utils.DatabaseError, utils.DatabaseError(*e[1].args), e[2])
>> File "/home/joe/Projects/django2-3/django/django/utils/py3.py", line
>> 167, in reraise
>> raise value.with_traceback(tb)
>> File
>> "/home/joe/Projects/django2-3/django/django/db/backends/postgresql_psycopg2/base.py",
>> line 54, in execute
>> return self.cursor.execute(query, args)
>> django.db.utils.DatabaseError: function upper(bytea) does not exist
>> LINE 1: ...WHERE UPPER("django_content_type"."name"::text) = UPPER('\x4...
>> ^
>> HINT: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>>
>>
>> ======================================================================
>> ERROR: test_recentactions_without_content_type
>> (regressiontests.admin_views.tests.AdminViewStringPrimaryKeyTest)
>> If a LogEntry is missing content_type it will not display it in span tag
>> under the hyperlink.
>>
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File
>> "/home/joe/Projects/django2-3/django/django/db/backends/postgresql_psycopg2/base.py",
>> line 54, in execute
>> return self.cursor.execute(query, args)
>> psycopg2.InternalError: current transaction is aborted, commands ignored
>> until end of transaction block
>>
>>
>> During handling of the above exception, another exception occurred:
>>
>>
>> Traceback (most recent call last):
>> File
>> "/home/joe/Projects/django2-3/django/tests/regressiontests/admin_views/tests.py",
>> line 1228, in tearDown
>> self.client.logout()
>> File "/home/joe/Projects/django2-3/django/django/test/client.py", line
>> 544, in logout
>> session.delete(session_key=session_cookie.value)
>> File
>> "/home/joe/Projects/django2-3/django/django/contrib/sessions/backends/db.py",
>> line 75, in delete
>> Session.objects.get(session_key=session_key).delete()
>> File "/home/joe/Projects/django2-3/django/django/db/models/manager.py",
>> line 131, in get
>> return self.get_query_set().get(*args, **kwargs)
>> File "/home/joe/Projects/django2-3/django/django/db/models/query.py",
>> line 361, in get
>> num = len(clone)
>> File "/home/joe/Projects/django2-3/django/django/db/models/query.py",
>> line 86, in __len__
>> self._result_cache = list(self.iterator())
>> File "/home/joe/Projects/django2-3/django/django/db/models/query.py",
>> line 293, in iterator
>> for row in compiler.results_iter():
>> File
>> "/home/joe/Projects/django2-3/django/django/db/models/sql/compiler.py",
>> line 699, in results_iter
>> for rows in self.execute_sql(MULTI):
>> File
>> "/home/joe/Projects/django2-3/django/django/db/models/sql/compiler.py",
>> line 754, in execute_sql
>> cursor.execute(sql, params)
>> File
>> "/home/joe/Projects/django2-3/django/django/db/backends/postgresql_psycopg2/base.py",
>> line 60, in execute
>> reraise(utils.DatabaseError, utils.DatabaseError(*e[1].args), e[2])
>> File "/home/joe/Projects/django2-3/django/django/utils/py3.py", line
>> 167, in reraise
>> raise value.with_traceback(tb)
>> File
>> "/home/joe/Projects/django2-3/django/django/db/backends/postgresql_psycopg2/base.py",
>> line 54, in execute
>> return self.cursor.execute(query, args)
>> django.db.utils.DatabaseError: current transaction is aborted, commands
>> ignored until end of transaction block
>>
>>
>> ======================================================================
>>
>> ERROR: test_existing (regressiontests.templates.loaders.EggLoaderTest)
>> A template can be loaded from an egg
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File
>> "/home/joe/Projects/django2-3/django/tests/regressiontests/templates/loaders.py",
>> line 88, in test_existing
>> contents, template_name = egg_loader.load_template_source("y.html")
>> File
>> "/home/joe/Projects/django2-3/django/django/template/loaders/eggs.py", line
>> 28, in load_template_source
>> raise TemplateDoesNotExist(template_name)
>> django.template.base.TemplateDoesNotExist: y.html
>>
>> PS: I too have a slow postgres even after I upped the shared_buffers and
>> effective_cache_size while disabling fsync, and it is still pretty darn
>> slow. (info from:
>> http://www.revsys.com/writings/postgresql-performance.html) I'm testing
>> w/ trunk to get a baseline w/ psycopg2. I'll admit I'm using a slow HDD,
>> but I waited well over an hour.
>>
>> When I get back from work, I'll try psycopg2 and MySQL again tonight.
>>
>
>
>
> --
> Joe & Anne Tennies
> [email protected]
>
--
Joe & Anne Tennies
[email protected]
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.
diff -r 78e28c7e53f4 tests/regressiontests/admin_views/tests.py
--- a/tests/regressiontests/admin_views/tests.py Tue Dec 06 09:02:40 2011 +0000
+++ b/tests/regressiontests/admin_views/tests.py Tue Dec 06 23:11:47 2011 -0600
@@ -1254,9 +1254,9 @@
def test_recentactions_without_content_type(self):
"If a LogEntry is missing content_type it will not display it in span tag under the hyperlink."
response = self.client.get('/test_admin/admin/')
- should_contain = b("""<a href="admin_views/modelwithstringprimarykey/%s/">%s</a>""" % (quote(self.pk), escape(self.pk)))
+ should_contain = """<a href="admin_views/modelwithstringprimarykey/%s/">%s</a>""" % (quote(self.pk), escape(self.pk))
self.assertContains(response, should_contain)
- should_contain = b("Model with string primary key") # capitalized in Recent Actions
+ should_contain = "Model with string primary key" # capitalized in Recent Actions
self.assertContains(response, should_contain)
logentry = LogEntry.objects.get(content_type__name__iexact=should_contain)
# http://code.djangoproject.com/ticket/10275
@@ -1265,9 +1265,9 @@
logentry.content_type = None
logentry.save()
- counted_presence_before = response.content.count(should_contain)
+ counted_presence_before = response.content.count(b(should_contain))
response = self.client.get('/test_admin/admin/')
- counted_presence_after = response.content.count(should_contain)
+ counted_presence_after = response.content.count(b(should_contain))
self.assertEqual(counted_presence_before - 1,
counted_presence_after)