Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self = <tests.test_tests_api.TestTestsCreate testMethod=test_can_create_tests>
- def setUp(self):
- self.test_user = get_user_model().objects.create_user(
- > 'testuser', 'test@example.com', 'testpassword')
- tests/test_tests_api.py:18:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.6/site-packages/django/contrib/auth/models.py:159: in create_user
- return self._create_user(username, email, password, **extra_fields)
- /usr/local/lib/python3.6/site-packages/django/contrib/auth/models.py:153: in _create_user
- user.save(using=self._db)
- /usr/local/lib/python3.6/site-packages/django/contrib/auth/base_user.py:80: in save
- super(AbstractBaseUser, self).save(*args, **kwargs)
- /usr/local/lib/python3.6/site-packages/django/db/models/base.py:808: in save
- force_update=force_update, update_fields=update_fields)
- /usr/local/lib/python3.6/site-packages/django/db/models/base.py:838: in save_base
- updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
- /usr/local/lib/python3.6/site-packages/django/db/models/base.py:924: in _save_table
- result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
- /usr/local/lib/python3.6/site-packages/django/db/models/base.py:963: in _do_insert
- using=using, raw=raw)
- /usr/local/lib/python3.6/site-packages/django/db/models/manager.py:85: in manager_method
- return getattr(self.get_queryset(), name)(*args, **kwargs)
- /usr/local/lib/python3.6/site-packages/django/db/models/query.py:1079: in _insert
- return query.get_compiler(using=using).execute_sql(return_id)
- /usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py:1112: in execute_sql
- cursor.execute(sql, params)
- /usr/local/lib/python3.6/site-packages/django/db/backends/utils.py:64: in execute
- return self.cursor.execute(sql, params)
- /usr/local/lib/python3.6/site-packages/django/db/utils.py:94: in __exit__
- six.reraise(dj_exc_type, dj_exc_value, traceback)
- /usr/local/lib/python3.6/site-packages/django/utils/six.py:685: in reraise
- raise value.with_traceback(tb)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- self = <django.db.backends.utils.CursorWrapper object at 0x7f6bca64ac18>
- sql = 'INSERT INTO "auth_user" ("password", "last_login", "is_superuser", "username", "first_name", "last_name", "email", "is_staff", "is_active", "date_joined") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "auth_user"."id"'
- params = ('pbkdf2_sha256$36000$idx1u0dyliye$xFUx3wV38rlah3fBHEGmJxFgY2giKnzL7w2Sx7/7eA0=', None, False, 'testuser', '', '', ...)
- def execute(self, sql, params=None):
- self.db.validate_no_broken_transaction()
- with self.db.wrap_database_errors:
- if params is None:
- return self.cursor.execute(sql)
- else:
- > return self.cursor.execute(sql, params)
- E django.db.utils.IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"
- E DETAIL: Key (username)=(testuser) already exists.
- /usr/local/lib/python3.6/site-packages/django/db/backends/utils.py:64: IntegrityError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement