Miscellaneous tools for django.
Look also at the siblings project: django-cms-tools (Tools/helpers around Django-CMS).
| | https://pypi.python.org/pypi/django-tools/ | | | github.com/jedie/django-tools/actions | | | codecov.io/gh/jedie/django-tools | | | coveralls.io/r/jedie/django-tools |
(Logo contributed by @reallinfo see #16)
try-out
e.g.:
~$ git clone https://github.com/jedie/django-tools.git
~$ cd django-tools/
~/django-tools$ ./manage.py
existing stuff
Serve User Media File
Serve settings.MEDIA_ROOT
files only for allowed users.
See separate README here: django_tools/serve_media_app
Mode Version Protect
Protect a model against overwriting a newer entry with an older one, by adding a auto increment version number.
See separate README here: django_tools/model_version_protect
OverwriteFileSystemStorage
A django filesystem storage that will overwrite existing files and can create backups, if content changed. usage:
class ExampleModel(models.Model):
foo_file = models.FileField(
storage=OverwriteFileSystemStorage(create_backups=True)
)
bar_image = models.ImageField(
storage=OverwriteFileSystemStorage(create_backups=False)
)
Backup made by appending a suffix and sequential number, e.g.:
- source....: foo.bar
- backup 1..: foo.bar.bak
- backup 2..: foo.bar.bak0
- backup 3..: foo.bar.bak1
Backup files are only made if file content changed. But at least one time!
Django Logging utils
Put this into your settings, e.g.:
from django_tools.unittest_utils.logging_utils import CutPathnameLogRecordFactory, FilterAndLogWarnings
# Filter warnings and pipe them to logging system
# Warnings of external packages are displayed only once and only the file path.
warnings.showwarning = FilterAndLogWarnings()
# Adds 'cut_path' attribute on log record. So '%(cut_path)s' can be used in log formatter.
logging.setLogRecordFactory(CutPathnameLogRecordFactory(max_length=50))
LOGGING = {
# ...
'formatters': {
'verbose': {
'format': '%(levelname)8s %(cut_path)s:%(lineno)-3s %(message)s'
},
},
# ...
}
(Activate warnings by, e.g.: export PYTHONWARNINGS=all
)
ThrottledAdminEmailHandler
ThrottledAdminEmailHandler works similar as the origin django.utils.log.AdminEmailHandler but is will throttle the number of mails that can be send in a time range. usage e.g.:
LOGGING = {
# ...
"handlers": {
"mail_admins": {
"level": "ERROR",
"class": "django_tools.log_utils.throttle_admin_email_handler.ThrottledAdminEmailHandler",
"formatter": "email",
"min_delay_sec": 20, # << -- skip mails in this time range
},
# ...
},
# ...
}
django_tools.template.loader.DebugCacheLoader
Insert template name as html comments, e.g.:
<!-- START 'foo/bar.html' -->
...
<!-- END 'foo/bar.html' -->
To use this, you must add django_tools.template.loader.DebugCacheLoader as template loader.
e.g.: Activate it only in DEBUG mode:
if DEBUG:
TEMPLATES[0]["OPTIONS"]["loaders"] = [
(
"django_tools.template.loader.DebugCacheLoader", (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
)
]
send text+html mails
A helper class to send text+html mails used the django template library.
You need two template files, e.g.:
You have to specify the template file like this: template_base="mail_test.{ext}"
Send via Celery task:
# settings.py
SEND_MAIL_CELERY_TASK_NAME="mail:send_task"
from django_tools.mail.send_mail import SendMailCelery
SendMailCelery(
template_base="mail_test.{ext}",
mail_context={"foo": "first", "bar": "second"},
subject="Only a test",
recipient_list="[email protected]"
).send()
Send without Celery:
from django_tools.mail.send_mail import SendMail
SendMail(
template_base="mail_test.{ext}",
mail_context={"foo": "first", "bar": "second"},
subject="Only a test",
recipient_list="[email protected]"
).send()
See also the existing unittests:
Delay tools
Sometimes you want to simulate when processing takes a little longer.
There exists django_tools.debug.delay.SessionDelay
and django_tools.debug.delay.CacheDelay
for this.
The usage will create logging entries and user messages, if user is authenticated.
More info in seperate django_tools/debug/README.creole file.
Filemanager library
Library for building django application like filemanager, gallery etc.
more info, read ./filemanager/README.creole
per-site cache middleware
Similar to django UpdateCacheMiddleware and FetchFromCacheMiddleware, but has some enhancements: 'per site cache' in ./cache/README.creole
smooth cache backends
Same as django cache backends, but adds cache.smooth_update()
to clears the cache smoothly depend on the current system load.
more info in: 'smooth cache backends' in ./cache/README.creole
local sync cache
Keep a local dict in a multi-threaded environment up-to-date. Usefull for cache dicts. More info, read DocString in ./local_sync_cache/local_sync_cache.py.
threadlocals middleware
For getting request object anywhere, use ./middlewares/ThreadLocal.py
Dynamic SITE_ID middleware
Note: Currently not maintained! TODO: Fix unittests for all python/django version
Set settings.SITE_ID dynamically with a middleware base on the current request domain name. Domain name alias can be specify as a simple string or as a regular expression.
more info, read ./dynamic_site/README.creole.
StackInfoStorage
Message storage like LegacyFallbackStorage, except, every message would have a stack info, witch is helpful, for debugging. Stack info would only be added, if settings DEBUG or MESSAGE_DEBUG is on. To use it, put this into your settings:
MESSAGE_STORAGE = "django_tools.utils.messages.StackInfoStorage"
More info, read DocString in ./utils/messages.py.
limit to usergroups
Limit something with only one field, by selecting:
- anonymous users
- staff users
- superusers
- ..all existing user groups..
More info, read DocString in ./limit_to_usergroups.py
permission helpers
See django_tools.permissions and unittests: django_tools_tests.test_permissions
form/model fields
- Directory field - check if exist and if in a defined base path
- language code field with validator
- Media Path field browse existign path to select and validate input
- sign seperated form/model field e.g. comma seperated field
- static path field
- url field A flexible version of the original django form URLField
unittests helpers
Selenium Test Cases
There are Firefox and Chromium test cases, with and without django StaticLiveServerTestCase!
Chromium + StaticLiveServer example:
from django_tools.selenium.chromedriver import chromium_available
from django_tools.selenium.django import SeleniumChromiumStaticLiveServerTestCase
@unittest.skipUnless(chromium_available(), "Skip because Chromium is not available!")
class ExampleChromiumTests(SeleniumChromiumStaticLiveServerTestCase):
def test_admin_login_page(self):
self.driver.get(self.live_server_url + "/admin/login/")
self.assert_equal_page_title("Log in | Django site admin")
self.assert_in_page_source('<form action="/admin/login/" method="post" id="login-form">')
self.assert_no_javascript_alert()
Firefox + StaticLiveServer example:
from django_tools.selenium.django import SeleniumFirefoxStaticLiveServerTestCase
from django_tools.selenium.geckodriver import firefox_available
@unittest.skipUnless(firefox_available(), "Skip because Firefox is not available!")
class ExampleFirefoxTests(SeleniumFirefoxStaticLiveServerTestCase):
def test_admin_login_page(self):
self.driver.get(self.live_server_url + "/admin/login/")
self.assert_equal_page_title("Log in | Django site admin")
self.assert_in_page_source('<form action="/admin/login/" method="post" id="login-form">')
self.assert_no_javascript_alert()
Test cases without StaticLiveServer:
from django_tools.selenium.chromedriver import SeleniumChromiumTestCase
from django_tools.selenium.geckodriver import SeleniumFirefoxTestCase
See also existing unitests here:
Setup Web Drivers
Selenium test cases needs the browser and the web driver.
SeleniumChromiumTestCase
and SeleniumFirefoxTestCase
will automaticly install the web driver via webdriver-manager
There is a small CLI (called django_tools_selenium
) to check / install the web drivers, e.g.:
~/django-tools$ poetry run django_tools_selenium install
~/django-tools$ poetry run django_tools_selenium info
Mockup utils
Create dummy PIL/django-filer images with Text, see:
usage/tests:
Model instance unittest code generator
Generate unittest code skeletons from existing model instance. You can use this feature as django manage command or as admin action.
Usage as management command, e.g.:
$ ./manage.py generate_model_test_code auth.
...
#
# pk:1 from auth.User <class 'django.contrib.auth.models.User'>
#
user = User.objects.create(
password='pbkdf2_sha256$36000$ybRfVQDOPQ9F$jwmgc5UsqRQSXxJs/NrZeTLguieUSSZfaSZbMmC+L5w=', # CharField, String (up to 128)
last_login=datetime.datetime(2018, 4, 24, 8, 27, 49, 578107, tzinfo=<UTC>), # DateTimeField, Date (with time)
is_superuser=True, # BooleanField, Boolean (Either True or False)
username='test', # CharField, String (up to 150)
first_name='', # CharField, String (up to 30)
last_name='', # CharField, String (up to 30)
email='', # CharField, Email address
is_staff=True, # BooleanField, Boolean (Either True or False)
is_active=True, # BooleanField, Boolean (Either True or False)
date_joined=datetime.datetime(2018, 3, 6, 17, 15, 50, 93136, tzinfo=<UTC>), # DateTimeField, Date (with time)
)
...
create users
django_tools.unittest_utils.user.create_user()
- create users, get_super_userdjango_tools.unittest_utils.user.get_super_user()
- get the first existing superuser
Isolated Filesystem decorator / context manager
django_tools.unittest_utils.isolated_filesystem.isolated_filesystem acts as either a decorator or a context manager. Useful to for tests that will create files/directories in current work dir, it does this:
- create a new temp directory
- change the current working directory to the temp directory
- after exit:
- Delete an entire temp directory tree
usage e.g.:
from django_tools.unittest_utils.isolated_filesystem import isolated_filesystem
with isolated_filesystem(prefix="temp_dir_prefix"):
open("foo.txt", "w").write("bar")
BaseUnittestCase
django_tools.unittest_utils.unittest_base.BaseUnittestCase contains some low-level assert methods:
- assertEqual_dedent()
Note: assert methods will be migrated to: django_tools.unittest_utils.assertments
in the future!
django_tools.unittest_utils.tempdir contains TempDir, a Context Manager Class:
with TempDir(prefix="foo_") as tempfolder:
# create a file:
open(os.path.join(tempfolder, "bar"), "w").close()
# the created temp folder was deleted with shutil.rmtree()
usage/tests:
DjangoCommandMixin
Helper to run shell commands. e.g.: "./manage.py cms check" in unittests.
usage/tests:
DOM compare in unittests
The Problem: You can’t easy check if e.g. some form input fields are in the response, because the form rendering use a dict for storing all html attributes. So, the ordering of form field attributes are not sorted and varied.
The Solution: You need to parse the response content into a DOM tree and compare nodes.
We add the great work of Gregor Müllegger at his GSoC 2011 form-rendering branch. You will have the following assert methods inherit from: django_tools.unittest_utils.unittest_base.BaseTestCase
- self.assertHTMLEqual() – for compare two HTML DOM trees
- self.assertDOM() – for check if nodes in response or not.
- self.assertContains() – Check if ond node occurs 'count’ times in response
More info and examples in ./django_tools_tests/test_dom_asserts.py
@set_string_if_invalid() decorator
Helper to check if there are missing template tags by set temporary 'string_if_invalid'
, see: https://docs.djangoproject.com/en/1.8/ref/templates/api/#invalid-template-variables
Usage, e.g.:
from django.test import SimpleTestCase
from django_tools.unittest_utils.template import TEMPLATE_INVALID_PREFIX, set_string_if_invalid
@set_string_if_invalid()
class TestMyTemplate(SimpleTestCase):
def test_valid_tag(self):
response = self.client.get('/foo/bar/')
self.assertNotIn(TEMPLATE_INVALID_PREFIX, response.content)
You can also decorate the test method ;)
unittest_utils/signals.py
SignalsContextManager
connect/disconnet signal callbacks via with statement
unittest_utils/assertments.py
The file contains some common assert functions:
assert_startswith
- Check if test starts with prefix.assert_endswith
- Check if text ends with suffix.assert_locmem_mail_backend
- Check if current email backend is the In-memory backend.- {{{assert_language_code() - Check if given language_code is in settings.LANGUAGES
assert_installed_apps()
- Check entries in settings.INSTALLED_APPSassert_is_dir
- Check if given path is a directoryassert_is_file
- Check if given path is a fileassert_path_not_exists
- Check if given path doesn't exists
Speedup tests
Speedup test run start by disable migrations, e.g.:
from django_tools.unittest_utils.disable_migrations import DisableMigrations
MIGRATION_MODULES = DisableMigrations()
small tools
debug_csrf_failure()
Display the normal debug page and not the minimal csrf debug page. More info in DocString here: django_tools/views/csrf.py
import lib helper
additional helper to the existing importlib
more info in the sourcecode: ./utils/importlib.py
http utils
Pimped HttpRequest to get some more information about a request. More info in DocString here: django_tools/utils/http.py
@display_admin_error
Developer helper to display silent errors in ModelAdmin.list_display callables. See: display_admin_error in decorators.py
upgrade virtualenv
A simple commandline script that calls pip install —-upgrade XY
for every package thats installed in a virtualenv.
Simply copy/symlink it into the root directory of your virtualenv and start it.
Note:Seems that this solution can't observe editables right.
To use it, without installing django-tools:
~/$ cd goto/your_env
.../your_env/$ wget https://github.com/jedie/django-tools/raw/master/django_tools/upgrade_virtualenv.py
.../your_env/$ chmod +x upgrade_virtualenv.py
.../your_env/$ ./upgrade_virtualenv.py
This script will be obsolete, if pip has a own upgrade command.
django_tools.utils.url.GetDict
Similar to origin django.http.QueryDict but:
- urlencode() doesn't add "=" to empty values: "?empty" instead of "?empty="
- always mutable
- output will be sorted (easier for tests ;)
More info, see tests: django_tools_tests/test_utils_url.py
SignedCookieStorage
Store information in signed Cookies, use django.core.signing. So the cookie data can't be manipulated from the client. Sources/examples:
Print SQL Queries
Print the used SQL queries via context manager.
usage e.g.:
from django_tools.unittest_utils.print_sql import PrintQueries
# e.g. use in unittests:
class MyTests(TestCase):
def test_foobar(self):
with PrintQueries("Create object"):
FooBar.objects.create("name"=foo)
# e.g. use in views:
def my_view(request):
with PrintQueries("Create object"):
FooBar.objects.create("name"=foo)
the output is like:
_______________________________________________________________________________
*** Create object ***
1 - INSERT INTO "foobar" ("name")
VALUES (foo)
-------------------------------------------------------------------------------
SetRequestDebugMiddleware
middleware to add debug bool attribute to request object. More info: ./debug/README.creole
TracebackLogMiddleware
Put traceback in log by call logging.exception() on process_exception()
Activate with:
MIDDLEWARE_CLASSES = (
...
'django_tools.middlewares.TracebackLogMiddleware.TracebackLogMiddleware',
...
)
FnMatchIps() - Unix shell-style wildcards in INTERNAL_IPS / ALLOWED_HOSTS
settings.py e.g.:
from django_tools.settings_utils import FnMatchIps
INTERNAL_IPS = FnMatchIps(["127.0.0.1", "::1", "192.168.*.*", "10.0.*.*"])
ALLOWED_HOSTS = FnMatchIps(["127.0.0.1", "::1", "192.168.*.*", "10.0.*.*"])
StdoutStderrBuffer()
redirect stdout + stderr to a string buffer. e.g.:
from django_tools.unittest_utils.stdout_redirect import StdoutStderrBuffer
with StdoutStderrBuffer() as buffer:
print("foo")
output = buffer.get_output() # contains "foo\n"
Management commands
permission_info
List all permissions for one django user.
(Needs 'django_tools'
in INSTALLED_APPS)
e.g.:
$ ./manage.py permission_info
No username given!
All existing users are:
foo, bar, john, doe
$ ./manage.py permission_info foo
All permissions for user 'test_editor':
is_active : yes
is_staff : yes
is_superuser : no
[*] admin.add_logentry
[*] admin.change_logentry
[*] admin.delete_logentry
[ ] auth.add_group
[ ] auth.add_permission
[ ] auth.add_user
...
logging_info
Shows a list of all loggers and marks which ones are configured in settings.LOGGING:
$ ./manage.py logging_info
nice_diffsettings
Similar to django 'diffsettings', but used pretty-printed representation:
$ ./manage.py nice_diffsettings
database_info
Just display some information about the used database and connections:
$ ./manage.py database_info
list_models
Just list all existing models in app_label.ModelName format. Useful to use this in 'dumpdata' etc:
$ ./manage.py list_models
..all others…
There exist many miscellaneous stuff. Look in the source, luke!
Backwards-incompatible changes
Old changes archived in git history here:
v0.51
All Selenium helper are deprecated, please migrate to Playwright ;)
v0.50
Removed old selenium helper function, deprecated since v0.43
Make all Selenium web driver instances persistent for the complete test run session. This speedup tests and fixed some bugs in Selenium.
This result in the same browser/webdriver settings for all test classes!
v0.55
Move supported Django/Python min. versions to: * Django 4.1, 4.2, 5.1 * Python 3.11, 3.12
Django compatibility
django-tools | django version | python |
---|---|---|
>= v0.56.0 | 4.1, 4.2, 5.1 | 3.11, 3.12 |
>= v0.52.0 | 3.2, 4.0, 4.1 | 3.8, 3.9, 3.10 |
>= v0.50.0 | 2.2, 3.2, 4.0 | 3.8, 3.9, 3.10 |
>= v0.49.0 | 2.2, 3.1, 3.2 | 3.7, 3.8, 3.9 |
>= v0.47.0 | 2.2, 3.0, 3.1 | >= 3.6, pypy3 |
>= v0.39 | 1.11, 2.0 | 3.5, 3.6, pypy3 |
>= v0.38.1 | 1.8, 1.11 | 3.5, 3.6, pypy3 |
>= v0.38.0 | 1.8, 1.11 | 3.5, 3.6 |
>= v0.37.0 | 1.8, 1.11 | 3.4, 3.5 |
>= v0.33.0 | 1.8, 1.11 | 2.7, 3.4, 3.5 |
v0.30.1-v0.32.14 | 1.8, 1.9, 1.10 | 2.7, 3.4, 3.5 |
v0.30 | 1.8, 1.9 | 2.7, 3.4 |
v0.29 | 1.6 - 1.8 | 2.7, 3.4 |
v0.26 | <=1.6 | |
v0.25 | <=1.4 |
(See also combinations for tox in pyproject.toml)
history
- v0.56.2
- 2024-08-25 - Bugfix: Remove empty package that shadows existing codes
- v0.56.1
- 2024-08-25 - Use typeguard in tests
- 2024-08-25 - Use cli_base update-readme-history
- 2024-08-25 - Update via manageprojects
- v0.56.0
- 2024-08-25 - Bugfix local test run with a real terminal ;)
- 2024-08-25 - Fix CI
- 2023-04-10 - Upgrade: use managed-django-projec, Remove deprecations, update supported versions
- v0.54.0
- 2022-09-15 - Bugfix version check
- 2022-08-23 - Replace README.creole with README.md
- 2022-08-26 - Run safety check in CI
- 2022-08-25 - NEW: SyslogHandler for easy logging to syslog
Expand older history entries ...
* [v0.53.0](https://github.com/jedie/django-tools/compare/v0.52.0...v0.53.0) * 2022-08-18 - v0.53.0 * 2022-08-18 - fix readme * 2022-08-18 - Fix tests * 2022-08-18 - order and clean run server kwargs * 2022-08-18 - fix gitignore * 2022-08-18 - fix tox run * 2022-08-18 - Bugfix Python 3.8 support * 2022-08-18 - polish run_testserver command * 2022-08-18 - update test project settings * 2022-08-18 - Fix "database_info" command and pprint to self.stdout stream * 2022-08-18 - Fix manage.sh by set "local" settings * 2022-08-18 - run-server: do not make stderr output -> use style * 2022-08-18 - NEW: MassContextManagerBase, DenyStdWrite + Updated: StdoutStderrBuffer * [v0.52.0](https://github.com/jedie/django-tools/compare/v0.51.0...v0.52.0) * 2022-08-17 - code cleanup * 2022-08-17 - Restrict `AlwaysLoggedInAsSuperUserMiddleware` to the admin. * 2022-08-17 - Move `run_testserver` management command from `django_tools_test_app` to `django_tools` and polish it. * 2022-07-02 - speedup CI * 2022-08-16 - fix tox and CI * 2022-08-16 - Update requirements * 2022-08-12 - Test with Django 3.2, 4.0 and 4.1 * 2022-08-12 - fix code style * [v0.51.0](https://github.com/jedie/django-tools/compare/v0.50.0...v0.51.0) * 2022-07-26 - NEW: check_editor_config() + release as v0.51.0 * 2022-07-26 - fix wrong editor config * 2022-07-26 - Add fancy icons to README * 2022-07-15 - Update requirements * 2022-07-02 - NEW: Playwright base Unittest class and login helper * 2022-07-02 - DEPRECATE all Selenium helper * 2022-07-02 - use: codecov/codecov-action@v2 * [v0.50.0](https://github.com/jedie/django-tools/compare/v0.49.0...v0.50.0) * 2022-05-29 - Update requirements * 2022-05-29 - fix Makefile * 2022-05-16 - replace assert_html_snapshot with assert_html_response_snapshot * 2022-05-16 - fix code style * 2022-04-15 - Update pythonapp.yml * 2022-02-05 - Enable console log output in *.log file * 2022-02-05 - Refactor selenium helper and use webdriver-manager to setup the webdriver * 2022-02-05 - Update publish.py * 2022-02-05 - lower max line length to 100 * 2022-02-05 - Remove linting in github actions, because it's done via pytest plugins * 2022-01-30 - Update README * 2022-01-30 - Expand tests with Python 3.10 and Django 4.0 * 2022-01-30 - Use darker as code formatter * 2022-01-13 - Fix github actions * 2022-01-13 - Apply flynt run * 2022-01-13 - Move flynt settings into pyproject.toml * [v0.49.0](https://github.com/jedie/django-tools/compare/v0.48.3...v0.49.0) * 2021-11-22 - Refactor selenium helper: * 2021-11-22 - log the found executable * 2021-11-22 - Remove w3c change * 2021-11-22 - change webdriver local to 'en_US.UTF-8' * 2021-11-22 - Fix #21 Set chrome accept_languages in headless mode * 2021-11-21 - fix test * 2021-11-20 - NEW: Model Version Protect * 2021-11-21 - Update selenium test helper * 2021-11-21 - update README * 2021-11-21 - refactor CI * 2021-11-21 - Remove Python 3.6 * 2021-11-21 - Update pythonapp.yml * 2021-11-21 - Refactor settings and move all project test files * 2021-11-21 - update project urls.py * 2021-11-21 - remove migration tests * 2021-11-21 - Pass current envrionment in call_manage_py() * 2021-11-20 - Bugfix test project * 2021-11-21 - NEW: AlwaysLoggedInAsSuperUserMiddleware * 2021-11-21 - Update README and check if "make" help always up2date * 2021-11-21 - Fix code style and make targets for this * 2021-11-21 - Update Makefile * 2021-11-21 - Refactor selenium test helpers * 2021-11-21 - code style * 2021-11-21 - copy DesiredCapabilities dict * 2021-11-21 - Fix make "lint" + "fix-code-style" and run fixing by tests * 2021-11-20 - Bugfix selenium chrome tests on github * 2021-11-20 - Bugfix tests: remove aboslute path from snapshots * 2021-11-20 - try to install chromedriver and geckodriver via seleniumbase in CI * 2021-11-20 - fix typo in log message * 2021-11-20 - Django update: smart_text() -> smart_str() * 2021-11-20 - use snapshot tests * 2021-11-20 - sync README * 2021-11-20 - Add "bx_py_utils" and use snapshot in tests * 2021-11-20 - Update README.creole * 2021-11-20 - Update tests * 2021-11-20 - Bugfix isolated_filesystem: It doesn't work as class decorator! * 2021-11-20 - Modernize the test project * 2021-11-20 - Update test * 2021-11-20 - Add poetry.lock and update requirements * 2021-11-20 - move tests * [v0.48.3](https://github.com/jedie/django-tools/compare/v0.48.2...v0.48.3) * 2020-12-20 - NEW: ImageDummy().in_memory_image_file() useful for e.g.: POST a image upload via Django's test client * [v0.48.2](https://github.com/jedie/django-tools/compare/v0.48.1...v0.48.2) * 2020-12-06 - relase as v0.48.2 * 2020-12-06 - test 0.48.2rc2 * 2020-12-06 - Handle if user token not exists * 2020-12-06 - change "serve_media_app" migration: Create UserMediaTokenModel for existing users * [v0.48.1](https://github.com/jedie/django-tools/compare/v0.48.0...v0.48.1) * 2020-12-06 - add .../serve_media_app/migrations/0001_initial.py * 2020-12-06 - add ./manage.sh helper * [v0.48.0](https://github.com/jedie/django-tools/compare/v0.47.0...v0.48.0) * 2020-12-06 - fist 'fix-code-style' then 'pytest' * 2020-12-06 - fix code style * 2020-12-06 - update README * 2020-12-06 - fix and update tests * 2020-12-06 - Add more info in logging output * 2020-12-06 - Add a note to "pytest-randomly" * 2020-12-06 - Support app config entries in get_filtered_apps() * 2020-12-06 - bugfix test project urls setup * 2020-11-27 - Update README.md * 2020-11-27 - NEW: "Serve User Media File" reuseable app * 2020-11-27 - NEW: django_tools.unittest_utils.signals.SignalsContextManager * 2020-11-27 - Change `ImageDummy` and make `text` optional * [v0.47.0](https://github.com/jedie/django-tools/compare/v0.46.1...v0.47.0) * 2020-11-26 - code style * 2020-11-26 - fix test setup and github actions * 2020-11-26 - update AUTHORS * 2020-11-26 - update .gitignore * 2020-11-26 - Update README and set v0.47.dev0 * 2020-11-26 - expand tox envlist, bugfix coverage settings and pytest call * 2020-11-26 - fix DjangoCommandMixin * 2020-11-26 - remove LoggingBuffer and update tests * 2020-11-26 - NEW: assert_in_logs() * 2020-11-26 - remove warnings check (Because of warnings from external apps) * 2020-11-26 - force_text -> force_str * 2020-11-26 - NEW: assert_warnings() and assert_no_warnings() * 2020-11-26 - fix test_set_env() * 2020-11-26 - use os.environ.setdefault * 2020-11-26 - ugettext -> gettext * 2020-11-26 - remove assertment * 2020-11-26 - Update some django imports for new django version * 2020-11-26 - update test_update_rst_readme() * 2020-11-26 - update pyproject.toml and move some external meta config files * 2020-11-05 - Disable fail-fast * 2020-11-05 - Fix broken UTs * 2020-11-05 - Ignore non-test files * 2020-11-05 - Ignore doctest import errors * 2020-11-05 - Fix two import errors * 2020-11-05 - Fix version compare * 2020-09-06 - CHORE: Add django 3.1 compatibility * 2020-11-05 - Trigger test job on pull_request event * 2020-11-05 - Fix broken UT due to deprecated options of pytest * 2020-07-04 - use f-strings * 2020-07-04 - render_to_response() -> render() * 2020-07-04 - update README.rst * 2020-07-04 - add github action badge * 2020-07-04 - Add "make update" * 2020-07-04 - Update README.creole * 2019-04-03 - Add files via upload * 2019-04-03 - Delete logo_white.png * 2019-04-03 - Delete logo_black.png * 2019-04-03 - Delete logo.png * [v0.46.1](https://github.com/jedie/django-tools/compare/v0.46.0...v0.46.1) * 2020-02-19 - Fix manage tests * 2020-02-19 - fixup! use shutil.which() in SeleniumChromiumTestCase() * 2020-02-19 - set "accept_languages" and disable "headless" mode * 2020-02-19 - use shutil.which() in SeleniumChromiumTestCase() * 2020-02-19 - NEW: "django_tools.middlewares.LogHeaders.LogRequestHeadersMiddleware" * 2020-02-19 - bugfix running test project dev. server * 2020-02-19 - merge code by using test code from poetry-publish * 2020-02-19 - less restricted dependency specification * [v0.46.0](https://github.com/jedie/django-tools/compare/v0.45.3...v0.46.0) * 2020-02-13 - update README and release as v0.46.0 * 2020-02-13 - work-a-round for failed test on github... * 2020-02-13 - WIP: Fix github CI * 2020-02-13 - +django_tools_tests/test_project_setup.py * 2020-02-13 - don't publish if README is not up-to-date * 2020-02-13 - use tox-gh-actions on github CI * 2020-02-13 - enable linting on CI * 2020-02-13 - fix code style * 2020-02-13 - code cleanup: remove six stuff * 2020-02-13 - apply code style * 2020-02-13 - update Makefile * 2020-02-13 - apply pyupgrade * 2020-02-13 - update tests * 2020-02-13 - Bugfix: Don't set settings.MEDIA_ROOT in DocTest * 2020-02-13 - use f-strings * 2020-02-13 - update selenium test * 2020-02-13 - update test setup * 2020-02-13 - remove "dynamic_site" * 2020-02-12 - WIP: use poetry * 2020-02-12 - remove lxml and use bleach.clean() in html2text() * 2020-02-12 - Update requirements-dev.txt * [v0.45.3](https://github.com/jedie/django-tools/compare/v0.45.2...v0.45.3) * 2019-08-25 - release v0.45.3 * 2019-08-25 - Add "excepted_exit_code" into DjangoCommandMixin methods * [v0.45.2](https://github.com/jedie/django-tools/compare/v0.45.1...v0.45.2) * 2019-06-25 - update test settings: MIDDLEWARE_CLASSES -> MIDDLEWARE * 2019-06-25 - add: ThrottledAdminEmailHandler * 2019-06-13 - Bugfix wrong BaseUnittestCase.assertEqual_dedent() refactoring * [v0.45.1](https://github.com/jedie/django-tools/compare/v0.45.0...v0.45.1) * 2019-04-03 - Bugfix print_mailbox if attachment is MIMEImage instance * 2019-04-01 - code cleanup * [v0.45.0](https://github.com/jedie/django-tools/compare/v0.44.2...v0.45.0) * 2019-04-01 - __version__ = "0.45.0" * 2019-04-01 - Update README.creole * 2019-04-01 - bugfix: str() needed for python 3.5 * 2019-04-01 - +=== OverwriteFileSystemStorage * 2019-04-01 - move "assert_equal_dedent" and "assert_in_dedent" * 2019-03-30 - use assert_pformat_equal for assertEqual_dedent, too * 2019-03-30 - only code formatting with black * 2019-03-30 - NEW: OverwriteFileSystemStorage * 2019-03-30 - new: assert_pformat_equal * 2019-03-30 - use python-colorlog * 2019-03-26 - NEW: {{{print_exc_plus()}}} - traceback with a listing of all the local variables * 2019-02-21 - Update email.py * 2019-02-21 - handle attachments/alternatives in unittest_utils.email.print_mailbox * [v0.44.2](https://github.com/jedie/django-tools/compare/v0.44.1...v0.44.2) * 2019-01-02 - typo in docstring * 2019-01-02 - only code formatting * 2019-01-02 - work-a-round for: https://github.com/andymccurdy/redis-py/issues/995 * 2019-01-02 - python3 + code formatting * [v0.44.1](https://github.com/jedie/django-tools/compare/v0.44.0...v0.44.1) * 2019-01-02 - only code formatting * 2019-01-02 - Don't deactivate existing log handler, just append the buffer handler. * [v0.44.0](https://github.com/jedie/django-tools/compare/v0.43.2...v0.44.0) * 2018-12-13 - NEW: {{{django_file = ImageDummy().create_django_file_info_image(text="")}}} * 2018-12-13 - mockup.ImageDummy: remove old API + make it useable without django-filer * [v0.43.2](https://github.com/jedie/django-tools/compare/v0.43.1...v0.43.2) * 2018-12-11 - Bugfix Selenium refactor: Use the class with the same functionality if old usage places are used. * [v0.43.1](https://github.com/jedie/django-tools/compare/v0.43.0...v0.43.1) * 2018-12-11 - v0.43.1 - Bugfix: Selenium test cases: clear window.localStorage after test run * [v0.43.0](https://github.com/jedie/django-tools/compare/v0.42.4...v0.43.0) * 2018-12-11 - NEW: Selenium helper to access window.localStorage * 2018-12-11 - Split selenium test cases: with and without Django StaticLiveServerTestCase * 2018-12-11 - only code cleanup * 2018-12-11 - bugfix test_filter_and_log_warnings_create_warning() * 2018-12-11 - move selenium helpers * 2018-12-11 - add DeprecationWarning decorators * [v0.42.4](https://github.com/jedie/django-tools/compare/v0.42.3...v0.42.4) * 2018-10-12 - bugfix: Some auth backends needs request object (e.g.: django-axes) * 2018-10-12 - only code cleanup * [v0.42.3](https://github.com/jedie/django-tools/compare/v0.42.2...v0.42.3) * 2018-10-10 - v0.42.3 * 2018-10-10 - update old tests * 2018-10-10 - ADD: assert is dir/file and assert_path_not_exists * [v0.42.2](https://github.com/jedie/django-tools/compare/v0.42.1...v0.42.2) * 2018-09-18 - NEW: assert_installed_apps() - Check entries in settings.INSTALLED_APPS * 2018-09-18 - +DeprecationWarning * [v0.42.1](https://github.com/jedie/django-tools/compare/v0.42.0...v0.42.1) * 2018-09-17 - release v0.42.1 * 2018-09-17 - NEW: django_tools.unittest_utils.assertments.assert_language_code * [v0.42.0](https://github.com/jedie/django-tools/compare/v0.41.0...v0.42.0) * 2018-09-07 - update tests * 2018-09-07 - v0.42.0 * 2018-09-07 - move manage commands "list_models" and "nice_diffsettings" * 2018-09-07 - update README * 2018-09-07 - remove old Backwards-incompatible changes entries from README * 2018-09-07 - bugfix email tests * 2018-09-07 - remove all celery helper * 2018-09-06 - Create logging_info.py * 2018-09-05 - +print_celery_info() * 2018-09-05 - fixup! check if task runs async by check if returned obj is AsyncResult * 2018-09-05 - default change to not eager mode * 2018-09-05 - check if task runs async by check if returned obj is AsyncResult * 2018-09-05 - test_task() -> on_message_test_task() * 2018-09-05 - use async_result.wait() with timeout as work-a-round for: https://github.com/celery/celery/issues/5034 * 2018-09-05 - +note about https://github.com/celery/celery/issues/5034 * 2018-09-05 - work-a-round for https://github.com/celery/celery/issues/5033 * 2018-09-05 - WIP: celery task unittest helpers * 2018-09-05 - pluggy>0.7 for https://github.com/pytest-dev/pytest/issues/3753 * [v0.41.0](https://github.com/jedie/django-tools/compare/v0.40.6...v0.41.0) * 2018-08-28 - v0.41.0 * 2018-08-28 - update test project and tests * 2018-08-28 - add test assertments * 2018-08-28 - remove obsolete tests * 2018-08-28 - NEW: unittest_utils/assertments.py * 2018-08-28 - remove the @task_always_eager() decorator. * [v0.40.6](https://github.com/jedie/django-tools/compare/v0.40.5...v0.40.6) * 2018-08-28 - v0.40.6 * 2018-08-28 - code style update * 2018-08-28 - Bugfix @task_always_eager() decorator * [v0.40.5](https://github.com/jedie/django-tools/compare/v0.40.4...v0.40.5) * 2018-08-27 - release 0.40.5 * 2018-08-27 - Bugfix: Use given manage.py filename * [v0.40.4](https://github.com/jedie/django-tools/compare/v0.40.3...v0.40.4) * 2018-08-21 - release v0.40.4 * 2018-08-21 - +test default value +test delete value * 2018-08-21 - Update README.creole * 2018-08-21 - NEW: django_tools.debug.delay * [v0.40.3](https://github.com/jedie/django-tools/compare/v0.40.2...v0.40.3) * 2018-07-18 - update README * 2018-07-18 - enhance selenium test cases * [v0.40.2](https://github.com/jedie/django-tools/compare/v0.40.1...v0.40.2) * 2018-07-04 - release v0.40.2 * 2018-07-04 - Fix tests, see: https://travis-ci.org/jedie/django-tools/jobs/400136378 * 2018-07-04 - Skip own selenium tests, if driver not available * 2018-07-04 - Bugfix selenium Test Case if driver is None * 2018-07-04 - code cleanup * 2018-07-04 - add yapf style config * 2018-07-04 - Update for django API change * [v0.40.1](https://github.com/jedie/django-tools/compare/v0.40.0...v0.40.1) * 2018-06-28 - Bugfix selenium test case if executable can't be found. * 2018-06-18 - Add django bug ticket links, too. * [v0.40.0](https://github.com/jedie/django-tools/compare/v0.39.6...v0.40.0) * 2018-06-14 - +== try-out * 2018-06-14 - setup django requirements * 2018-06-14 - add example code into README * 2018-06-14 - +chromium_available() and firefox_available() * 2018-06-14 - update DocTests * 2018-06-14 - typo in "executable" * 2018-06-14 - try without "MOZ_HEADLESS=1" because "headless" set here: * 2018-06-14 - cleanup * 2018-06-14 - fixup! fix travis CI: install geckodriver * 2018-06-14 - fix travis CI: install geckodriver * 2018-06-14 - fixup! try to fix travis and chromedriver * 2018-06-14 - +SeleniumFirefoxTestCase and more docs * 2018-06-14 - try to fix travis and chromedriver * 2018-06-13 - fixup! try to find the webdriver executeable * 2018-06-13 - try to find the webdriver executeable * 2018-06-13 - +django-debug-toolbar * 2018-06-13 - Add selenium test cases, fix test project and tests * 2018-06-13 - just add admindocs and flatpages into test project settings * 2018-06-13 - better error messages * [v0.39.6](https://github.com/jedie/django-tools/compare/v0.39.5...v0.39.6) * 2018-05-04 - README * 2018-05-04 - Don't hide Autofields * 2018-05-04 - code style cleanup * [v0.39.5](https://github.com/jedie/django-tools/compare/v0.39.4...v0.39.5) * 2018-04-24 - +nargs="?" * 2018-04-24 - yield sorted * 2018-04-24 - we add "admin_tools" * 2018-04-24 - Update README.creole * 2018-04-24 - NEW: Model unittest code generator as admin action and manage command * 2018-04-24 - update pytest and use new --new-first * 2018-04-06 - clarify what CutPathnameLogRecordFactory does * [v0.39.4](https://github.com/jedie/django-tools/compare/v0.39.3...v0.39.4) * 2018-04-06 - NEW: FilterAndLogWarnings and CutPathnameLogRecordFactory * [v0.39.3](https://github.com/jedie/django-tools/compare/v0.39.2...v0.39.3) * 2018-03-22 - add kwarg 'exclude_actions' to get_filtered_permissions * [v0.39.2](https://github.com/jedie/django-tools/compare/v0.39.1...v0.39.2) * 2018-03-22 - NEW: ParlerDummyGenerator + iter_languages * [v0.39.1](https://github.com/jedie/django-tools/compare/v0.39.0...v0.39.1) * 2018-03-19 - ignore 'pypy3-django111' failure * 2018-03-19 - remove obsolete code * 2018-03-19 - return result from SendMailCelery().send() * 2018-03-19 - +test_SendMailCelery_more_mails() * 2018-03-19 - +django_tools.unittest_utils.email.print_mailbox() * 2018-03-11 - Update setup.py * [v0.39.0](https://github.com/jedie/django-tools/compare/v0.38.9...v0.39.0) * 2018-03-02 - run tests with django 2.0 instead of django 1.8 * 2018-03-02 - Bugfix for python <=3.5 * 2018-03-02 - django_tools/unittest_utils/{celery.py => celery_utils.py} * 2018-03-02 - update history * 2018-03-02 - +Isolated Filesystem decorator / context manager * 2018-02-19 - +.pytest_cache * 2018-02-19 - update tests * 2018-02-19 - remove Py2 stuff * [v0.38.9](https://github.com/jedie/django-tools/compare/v0.38.8...v0.38.9) * 2018-02-05 - lowering log level "error" -> "debug" on missing permissions * [v0.38.8](https://github.com/jedie/django-tools/compare/v0.38.7...v0.38.8) * 2018-02-05 - release v0.38.8 * 2018-02-05 - bugfix compare link * 2018-02-05 - use from celery import shared_task instead of djcelery_transactions * 2018-02-05 - +skip_missing_interpreters = True * 2018-01-19 - better error message if app label not found in get_filtered_permissions() * [v0.38.7](https://github.com/jedie/django-tools/compare/v0.38.6...v0.38.7) * 2018-01-15 - Add missing arguments (like "attachments", "cc" etc.) to SendMailCelery * [v0.38.6](https://github.com/jedie/django-tools/compare/v0.38.5...v0.38.6) * 2018-01-08 - update README * 2018-01-08 - add POST data to browser debug * 2018-01-08 - better sort * 2018-01-08 - remove duplicate entries from template list * 2018-01-03 - +./manage.py clear_cache * [v0.38.5](https://github.com/jedie/django-tools/compare/v0.38.4...v0.38.5) * 2018-01-02 - +test_wrong_messages() * 2018-01-02 - NEW: assertMessages() * [v0.38.4](https://github.com/jedie/django-tools/compare/v0.38.3...v0.38.4) * 2017-12-28 - Bugfix attach user group on existing user * [v0.38.3](https://github.com/jedie/django-tools/compare/v0.38.2...v0.38.3) * 2017-12-28 - remove permissions, too * [v0.38.2](https://github.com/jedie/django-tools/compare/v0.38.1...v0.38.2) * 2017-12-27 - add: ./manage.py update_permissions * 2017-12-27 - +Helper to start pytest with arguments * 2017-12-27 - use log.exception() if permission not found * [v0.38.1](https://github.com/jedie/django-tools/compare/v0.38.0...v0.38.1) * 2017-12-21 - Update setup.py * 2017-12-20 - + coveralls * 2017-12-20 - cleanup * 2017-12-20 - use pypy3 ans -tox-travis * 2017-12-20 - refactor travis/tox/pytest * 2017-12-20 - don't test with unsupported django versions * 2017-12-20 - update travis/tox config and try to tests with more django versions * 2017-12-20 - Fix Tests, see: * 2017-12-20 - Update .travis.yml * [v0.38.0](https://github.com/jedie/django-tools/compare/v0.37.0...v0.38.0) * 2017-12-19 - use python3 * 2017-12-19 - +test_get_or_create_user_and_group() * 2017-12-19 - test with python 3.5 and 3.6 * 2017-12-19 - update README * 2017-12-19 - work-around for https://github.com/travis-ci/travis-ci/issues/4794 * 2017-12-19 - split user and group creation code * 2017-12-19 - +get_or_create_user_and_group() * 2017-12-14 - +BaseUnittestCase.get_admin_add_url() * 2017-12-13 - Bugfix tests * 2017-12-13 - NEW: BaseUnittestCase.get_admin_change_url() * 2017-12-13 - if print_filtered_html: print used template * 2017-12-12 - NEW: BaseUnittestCase.assert_startswith() and BaseUnittestCase.assert_endswith() * [v0.37.0](https://github.com/jedie/django-tools/compare/v0.36.0...v0.37.0) * 2017-12-08 - +print_filtered_html * 2017-12-08 - add "dir" agument to debug_response() * 2017-12-07 - unify permission sort * 2017-12-07 - Use always the permission format from user.has_perm(): "links
| Homepage | https://github.com/jedie/django-tools | | PyPi | https://pypi.python.org/pypi/django-tools/ |