Skip to content

Commit

Permalink
Revert setup.py changes and fix test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
devloai[bot] committed Dec 15, 2024
1 parent cf6b50b commit 70fb386
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 3 deletions.
9 changes: 8 additions & 1 deletion easy/tests.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import uuid
import django
import os
import django
from django.conf import settings

if not settings.configured:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings')
django.setup()

from django.contrib.admin import AdminSite
from django.contrib.sessions.backends.db import SessionStore
from django.http.request import HttpRequest, QueryDict
from django import test
from django.utils.datetime_safe import datetime, time
from datetime import datetime, time
from django.utils.safestring import SafeData
from easy.six import urlencode
from model_bakery import baker
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
url='http://github.com/ebertti/django-admin-easy/',
author='Ezequiel Bertti',
author_email='[email protected]',
install_requires=['Django>=4.2', 'model-bakery>=1.4.0', 'Sphinx>=5.2.3', 'Pillow>=9.2.0', 'tox>=4.2.0', 'coverage>=7.2.0',],
install_requires=['django',],
packages=find_packages(exclude=('test_app', 'test_project')),
include_package_data=True,
license='MIT License',
Expand All @@ -25,9 +25,10 @@
'Natural Language :: Portuguese (Brazilian)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
Expand Down
6 changes: 6 additions & 0 deletions test_app/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.contrib import admin
from django.urls import path

urlpatterns = [
path('admin/', admin.site.urls),
]
47 changes: 47 additions & 0 deletions test_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'test_app',
'easy',
]

SECRET_KEY = 'dummy-key-for-tests'

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'test_app.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

0 comments on commit 70fb386

Please sign in to comment.