SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. self = <tests.test_tests_api.TestTestsCreate testMethod=test_can_create_tests>
  2.  
  3.     def setUp(self):
  4.         self.test_user = get_user_model().objects.create_user(
  5. >           'testuser', 'test@example.com', 'testpassword')
  6.  
  7. tests/test_tests_api.py:18:
  8. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.6/site-packages/django/contrib/auth/models.py:159: in create_user
  9.     return self._create_user(username, email, password, **extra_fields)
  10. /usr/local/lib/python3.6/site-packages/django/contrib/auth/models.py:153: in _create_user
  11.     user.save(using=self._db)
  12. /usr/local/lib/python3.6/site-packages/django/contrib/auth/base_user.py:80: in save
  13.     super(AbstractBaseUser, self).save(*args, **kwargs)
  14. /usr/local/lib/python3.6/site-packages/django/db/models/base.py:808: in save
  15.     force_update=force_update, update_fields=update_fields)
  16. /usr/local/lib/python3.6/site-packages/django/db/models/base.py:838: in save_base
  17.     updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  18. /usr/local/lib/python3.6/site-packages/django/db/models/base.py:924: in _save_table
  19.     result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  20. /usr/local/lib/python3.6/site-packages/django/db/models/base.py:963: in _do_insert
  21.     using=using, raw=raw)
  22. /usr/local/lib/python3.6/site-packages/django/db/models/manager.py:85: in manager_method
  23.     return getattr(self.get_queryset(), name)(*args, **kwargs)
  24. /usr/local/lib/python3.6/site-packages/django/db/models/query.py:1079: in _insert
  25.     return query.get_compiler(using=using).execute_sql(return_id)
  26. /usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py:1112: in execute_sql
  27.     cursor.execute(sql, params)
  28. /usr/local/lib/python3.6/site-packages/django/db/backends/utils.py:64: in execute
  29.     return self.cursor.execute(sql, params)
  30. /usr/local/lib/python3.6/site-packages/django/db/utils.py:94: in __exit__
  31.     six.reraise(dj_exc_type, dj_exc_value, traceback)
  32. /usr/local/lib/python3.6/site-packages/django/utils/six.py:685: in reraise
  33.     raise value.with_traceback(tb)
  34. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  35.  
  36. self = <django.db.backends.utils.CursorWrapper object at 0x7f6bca64ac18>
  37. 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"'
  38. params = ('pbkdf2_sha256$36000$idx1u0dyliye$xFUx3wV38rlah3fBHEGmJxFgY2giKnzL7w2Sx7/7eA0=', None, False, 'testuser', '', '', ...)
  39.  
  40.     def execute(self, sql, params=None):
  41.         self.db.validate_no_broken_transaction()
  42.         with self.db.wrap_database_errors:
  43.             if params is None:
  44.                 return self.cursor.execute(sql)
  45.             else:
  46. >               return self.cursor.execute(sql, params)
  47. E               django.db.utils.IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"
  48. E               DETAIL:  Key (username)=(testuser) already exists.
  49.  
  50. /usr/local/lib/python3.6/site-packages/django/db/backends/utils.py:64: IntegrityError
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top