import os
import tempfile

SECRET_KEY = 'WE DONT CARE ABOUT IT'

if "postgresql" in os.getenv("TOX_ENV_NAME", ""):
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            # Should be the same defined in .travis.yml
            'NAME': 'dirtyfields_test',
            # postgres user is by default created in travis-ci
            'USER': os.getenv('POSTGRES_USER', 'postgres'),
            # postgres user has no password on travis-ci
            'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''),
            'HOST': 'localhost',
            'PORT': '5432',  # default postgresql port
        }
    }
else:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': 'dirtyfields.db',
        }
    }

INSTALLED_APPS = ('tests', )

MEDIA_ROOT = tempfile.mkdtemp(prefix="django-dirtyfields-test-media-root-")

import os
import secrets
import tempfile

SECRET_KEY = secrets.token_hex()

if "postgresql" in os.getenv("TOX_ENV_NAME", ""):
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            # Should be the same defined in .travis.yml
            'NAME': 'dirtyfields_test',
            # postgres user is by default created in travis-ci
            'USER': os.getenv('POSTGRES_USER', 'postgres'),
            # postgres user has no password on travis-ci
            'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''),
            'HOST': 'localhost',
            'PORT': '5432',  # default postgresql port
        }
    }
else:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': 'dirtyfields.db',
        }
    }

INSTALLED_APPS = ('tests', )

MEDIA_ROOT = tempfile.mkdtemp(prefix="django-dirtyfields-test-media-root-")

Use a different django secret key for each test run.
Use a different django secret key for each test run.

  import os
+ import secrets
  import tempfile
  
- SECRET_KEY = 'WE DONT CARE ABOUT IT'
+ SECRET_KEY = secrets.token_hex()
  
  if "postgresql" in os.getenv("TOX_ENV_NAME", ""):
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.postgresql',
              # Should be the same defined in .travis.yml
              'NAME': 'dirtyfields_test',
              # postgres user is by default created in travis-ci
              'USER': os.getenv('POSTGRES_USER', 'postgres'),
              # postgres user has no password on travis-ci
              'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''),
              'HOST': 'localhost',
              'PORT': '5432',  # default postgresql port
          }
      }
  else:
      DATABASES = {
          'default': {
              'ENGINE': 'django.db.backends.sqlite3',
              'NAME': 'dirtyfields.db',
          }
      }
  
  INSTALLED_APPS = ('tests', )
  
  MEDIA_ROOT = tempfile.mkdtemp(prefix="django-dirtyfields-test-media-root-")
  
Use a different django secret key for each test run.
## Code Before:
import os
import tempfile

SECRET_KEY = 'WE DONT CARE ABOUT IT'

if "postgresql" in os.getenv("TOX_ENV_NAME", ""):
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            # Should be the same defined in .travis.yml
            'NAME': 'dirtyfields_test',
            # postgres user is by default created in travis-ci
            'USER': os.getenv('POSTGRES_USER', 'postgres'),
            # postgres user has no password on travis-ci
            'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''),
            'HOST': 'localhost',
            'PORT': '5432',  # default postgresql port
        }
    }
else:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': 'dirtyfields.db',
        }
    }

INSTALLED_APPS = ('tests', )

MEDIA_ROOT = tempfile.mkdtemp(prefix="django-dirtyfields-test-media-root-")

## Instruction:
Use a different django secret key for each test run.
## Code After:
import os
import secrets
import tempfile

SECRET_KEY = secrets.token_hex()

if "postgresql" in os.getenv("TOX_ENV_NAME", ""):
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            # Should be the same defined in .travis.yml
            'NAME': 'dirtyfields_test',
            # postgres user is by default created in travis-ci
            'USER': os.getenv('POSTGRES_USER', 'postgres'),
            # postgres user has no password on travis-ci
            'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''),
            'HOST': 'localhost',
            'PORT': '5432',  # default postgresql port
        }
    }
else:
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': 'dirtyfields.db',
        }
    }

INSTALLED_APPS = ('tests', )

MEDIA_ROOT = tempfile.mkdtemp(prefix="django-dirtyfields-test-media-root-")
