Hi all,

I'm using latest svn django with mysql.  I'm getting the failure below
when I run 'python manage.py test'.  The failing lines seem to be:

BASIC_TESTS = """
>>> from django.contrib.auth.models import User, AnonymousUser
>>> u = User.objects.create_user('testuser', 't...@example.com', 'testpw')

But when I run 'python manage.py shell':

In [1]: from django.contrib.auth.models import User, AnonymousUser
In [2]: u = User.objects.create_user('testuser', 't...@example.com',
'testpw')
In [3]: u.has_usable_password()
Out[3]: True

It works!?

The error I'm seeing from manage.py test is below.  Any ideas?
Couldn't see any errors in the mysql log.

$ python manage.py test
/var/lib/python-support/python2.6/MySQLdb/__init__.py:34:
DeprecationWarning: the sets module is deprecated
  from sets import ImmutableSet
Creating test database...
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table whitelist_whitelist
Installing index for auth.Permission model
Installing index for auth.Message model
Installing index for admin.LogEntry model
Installing index for whitelist.Whitelist model
.......................................................F.....
======================================================================
FAIL: Doctest: django.contrib.auth.tests.__test__.BASIC_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/django/test/_doctest.py",
line 2180, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
django.contrib.auth.tests.__test__.BASIC_TESTS
  File "/usr/lib/python2.6/dist-packages/django/contrib/auth/tests/
__init__.py", line unknown line number, in BASIC_TESTS
----------------------------------------------------------------------
File "/usr/lib/python2.6/dist-packages/django/contrib/auth/tests/
__init__.py", line ?, in
django.contrib.auth.tests.__test__.BASIC_TESTS
Failed example:
    u = User.objects.create_user('testuser', 't...@example.com',
'testpw')
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.6/dist-packages/django/test/_doctest.py",
line 1267, in __run
        compileflags, 1) in test.globs
      File "<doctest django.contrib.auth.tests.__test__.BASIC_TESTS[1]
>", line 1, in <module>
        u = User.objects.create_user('testuser', 't...@example.com',
'testpw')
      File "/usr/lib/python2.6/dist-packages/django/contrib/auth/
models.py", line 105, in create_user
        user.save()
      File "/usr/lib/python2.6/dist-packages/django/db/models/
base.py", line 410, in save
        self.save_base(force_insert=force_insert,
force_update=force_update)
      File "/usr/lib/python2.6/dist-packages/django/db/models/
base.py", line 495, in save_base
        result = manager._insert(values, return_id=update_pk)
      File "/usr/lib/python2.6/dist-packages/django/db/models/
manager.py", line 177, in _insert
        return insert_query(self.model, values, **kwargs)
      File "/usr/lib/python2.6/dist-packages/django/db/models/
query.py", line 1087, in insert_query
        return query.execute_sql(return_id)
      File "/usr/lib/python2.6/dist-packages/django/db/models/sql/
subqueries.py", line 320, in execute_sql
        cursor = super(InsertQuery, self).execute_sql(None)
      File "/usr/lib/python2.6/dist-packages/django/db/models/sql/
query.py", line 2369, in execute_sql
        cursor.execute(sql, params)
      File "/usr/lib/python2.6/dist-packages/django/db/backends/mysql/
base.py", line 84, in execute
        return self.cursor.execute(query, args)
      File "/var/lib/python-support/python2.6/MySQLdb/cursors.py",
line 166, in execute
        self.errorhandler(self, exc, value)
      File "/var/lib/python-support/python2.6/MySQLdb/connections.py",
line 35, in defaulterrorhandler
        raise errorclass, errorvalue
    IntegrityError: (1062, "Duplicate entry 'testuser' for key 2")

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to