These are chat archives for mirumee/saleor

17th
May 2018
NyanKiyoshi
@NyanKiyoshi
May 17 2018 19:09

I did not fully check, but if someone could look at this, it happened to me during a build in Travis:

=================================== FAILURES ===================================
____________________________ test_create_fake_users ____________________________

self = <django.db.backends.utils.CursorWrapper object at 0x7fee8cc6e978>
sql = 'INSERT INTO "account_user" ("password", "last_login", "is_superuser", "email", "is_staff", "is_active", "note", "date...dress_id", "default_billing_address_id") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "account_user"."id"'
params = ('pbkdf2_sha256$36000$Or2VM6hoVfbS$3rT98d7tVp6cTc6AhzgP1tIuznHGGwnf6gg/qdybnPk=', None, False, 'brandon.smith@example.com', False, True, ...)

    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               psycopg2.IntegrityError: duplicate key value violates unique constraint "userprofile_user_email_key"
E               DETAIL:  Key (email)=(brandon.smith@example.com) already exists.

Looks like the random data can generate users with duplicate data. (5108f6765814b11a84edf88bc27ee04e64f750be)