Compare commits

...

20 Commits

Author SHA1 Message Date
Fabio Caccamo db7c12fdb4 Added CHANGELOG and updated version. [ci skip] 2019-05-09 11:26:03 +02:00
Fabio Caccamo 5b0a5e4c46 Merge pull request #62 from pooyamb/master
Fix #52: Broken migration on postgres/windows
2019-05-09 10:41:27 +02:00
Pouya Mobasher Behrouz 0f1dde545e Fix #52: Broken migration on postgres/windows 2019-05-07 18:44:00 +04:30
Fabio Caccamo b45e357418 Updated .travis 2019-04-29 18:44:29 +02:00
Fabio Caccamo fa6c79c367 Updated .travis 2019-04-29 18:37:34 +02:00
Fabio Caccamo 760609cafd Updated .travis 2019-04-29 18:27:26 +02:00
Fabio Caccamo cb3443aa4c Added django 2.2 to tox and travis and updated README. 2019-04-29 17:51:51 +02:00
Fabio Caccamo 9384c6db79 Updated version. 2019-04-29 17:36:47 +02:00
Fabio Caccamo 1a800d7d6a Fixed admin duplicated count query. 2019-04-29 17:36:36 +02:00
Fabio Caccamo 352701ae7d Added admin theme caching to remove duplicated queries. Fixed #19 2019-04-29 17:35:24 +02:00
Fabio Caccamo b4d0b4c985 Added django-dynamic-raw-id support - #61 2019-04-29 16:38:28 +02:00
Fabio Caccamo 26e67dab66 Updated app title italian localization. 2019-04-29 16:37:56 +02:00
Fabio Caccamo e604dcdffa Updated version [ci skip] 2019-03-28 12:15:30 +01:00
Fabio Caccamo 9b56343a81 Added idempotent deploy support. 2019-03-28 12:08:17 +01:00
Fabio Caccamo aef2d56fba Updated version. 2019-03-22 11:41:40 +01:00
Fabio Caccamo cb7a358c6c Fixed raw-id-field whith django-admin-interface #58 2019-03-22 11:41:31 +01:00
Fabio Caccamo c8690b316b Updated version. [ci skip] 2019-03-21 10:27:49 +01:00
Fabio Caccamo 91bba7f522 Merge pull request #57 from merwok-forks/master
Update French localization
2019-03-21 10:16:46 +01:00
Éric Araujo 439902dce8 fix typo 2019-03-20 14:15:39 -04:00
Éric Araujo 19854f70a3 update french localization 2019-03-20 14:14:44 -04:00
21 changed files with 325 additions and 48 deletions
+13
View File
@@ -36,6 +36,8 @@ env:
- TOX_ENV=py35-dj20-postgres
- TOX_ENV=py35-dj21-sqlite
- TOX_ENV=py35-dj21-postgres
# - TOX_ENV=py35-dj22-sqlite
- TOX_ENV=py35-dj22-postgres
matrix:
include:
- python: "3.6"
@@ -50,6 +52,10 @@ matrix:
env:
- TOX_ENV=py36-dj21-sqlite
- TOX_ENV=py36-dj21-postgres
- python: "3.6"
env:
- TOX_ENV=py36-dj22-sqlite
- TOX_ENV=py36-dj22-postgres
- python: "3.6"
env:
- TOX_ENV=py36-djmaster-sqlite
@@ -68,6 +74,13 @@ matrix:
dist: xenial
language: python
sudo: required
- python: "3.7"
env:
- TOX_ENV=py37-dj22-sqlite
- TOX_ENV=py37-dj22-postgres
dist: xenial
language: python
sudo: required
- python: "3.7"
env:
- TOX_ENV=py37-djmaster-sqlite
+146
View File
@@ -0,0 +1,146 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.10.5] - 2019-05-09
- Fixed broken migration on postgres/windows. #52
## [0.10.4] - 2019-03-29
- Added django 2.2 to tox and travis.
- Fixed admin duplicated count query.
- Added admin theme caching to remove duplicated queries. #19
- Added django-dynamic-raw-id support. #61
- Updated app title italian localization.
## [0.10.3] - 2019-03-28
- Fixed idempotent deploy support. #40
## [0.10.2] - 2019-03-22
- Fixed raw-id-field whith django-admin-interface. #58
## [0.10.1] - 2019-03-20
- Updated french localization.
## [0.10.0] - 2019-02-21
- Updated messages.
- Added related modal close button. #45
- Updated fields verbose names.
- Added environment options. #56
## [0.9.3] - 2019-02-06
- Enabled travis pip cache.
- Splitted tests to multiple files.
- Added env badge to favicon.
## [0.9.2] - 2019-01-11
- Fixed cancel button does not work. #53
- Fixed IntegrityError on postgres
## [0.9.1] - 2019-01-11
- Fixed missing migration. #51
## [0.9.0] - 2018-11-13
- Added French localization.
- Added Italian localization.
- Added Spanish localization.
- Added internationalization support.
## [0.8.2] - 2018-10-24
## [0.8.1] - 2018-10-11
## [0.8.0] - 2018-08-31
## [0.7.0] - 2018-02-06
## [0.6.3] - 2018-02-05
## [0.6.2] - 2018-02-01
## [0.6.1] - 2018-01-31
## [0.6.0] - 2017-11-23
## [0.5.9] - 2017-10-04
## [0.5.8] - 2017-09-29
## [0.5.7] - 2017-09-29
## [0.5.6] - 2017-09-29
## [0.5.5] - 2017-09-27
## [0.5.4] - 2017-09-27
## [0.5.3] - 2017-08-24
## [0.5.2] - 2017-07-13
## [0.5.1] - 2017-06-13
## [0.5.0] - 2017-06-09
## [0.4.6] - 2017-05-24
## [0.4.5] - 2017-05-19
## [0.4.4] - 2017-05-18
## [0.4.3] - 2017-05-16
## [0.4.2] - 2017-05-11
## [0.4.1] - 2017-05-04
## [0.4.0] - 2017-04-14
## [0.3.2] - 2017-03-29
## [0.3.1] - 2017-03-29
## [0.3.0] - 2017-02-09
## [0.2.1] - 2016-11-08
## [0.2.0] - 2016-09-10
## [0.1.9] - 2016-09-04
## [0.1.8] - 2016-08-05
## [0.1.7] - 2016-06-29
## [0.1.6] - 2016-04-13
## [0.1.5] - 2016-02-24
## [0.1.4] - 2016-02-15
## [0.1.3] - 2015-12-03
## [0.1.2] - 2015-11-25
## [0.1.1] - 2015-11-13
## [0.0.1] - 2015-11-13
### Added
- Added setup files to make the package installable using pip.
- Added ckeditor light skin.
- Added support to dropdown list filter.
- Added post_migrate handler to create the default theme after install.
[0.10.5]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.10.5
[0.10.4]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.10.4
[0.10.3]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.10.3
[0.10.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.10.2
[0.10.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.10.1
[0.10.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.10.0
[0.9.3]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.9.3
[0.9.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.9.2
[0.9.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.9.1
[0.9.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.9.0
[0.8.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.8.2
[0.8.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.8.1
[0.8.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.8.0
[0.7.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.7.0
[0.6.3]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.6.3
[0.6.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.6.2
[0.6.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.6.1
[0.6.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.6.0
[0.5.9]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.9
[0.5.8]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.8
[0.5.7]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.7
[0.5.6]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.6
[0.5.5]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.5
[0.5.4]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.4
[0.5.3]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.3
[0.5.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.2
[0.5.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.1
[0.5.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.5.0
[0.4.6]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.6
[0.4.5]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.5
[0.4.4]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.4
[0.4.3]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.3
[0.4.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.2
[0.4.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.1
[0.4.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.4.0
[0.3.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.3.2
[0.3.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.3.1
[0.3.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.3.0
[0.2.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.2.1
[0.2.0]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.2.0
[0.1.9]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.9
[0.1.8]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.8
[0.1.7]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.7
[0.1.6]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.6
[0.1.5]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.5
[0.1.4]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.4
[0.1.3]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.3
[0.1.2]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.2
[0.1.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.1.1
[0.0.1]: https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.0.1
+3 -2
View File
@@ -18,15 +18,16 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
- List filter dropdown *(optional)*
- `NEW` **Related modal** *(instead of the old popup window, optional)*
- `NEW` **Environment name/marker**
- Style optimizations for:
- Compatibility / Style optimizations for:
- `django-ckeditor`
- `django-dynamic-raw-id`
- `django-modeltranslation`
- `django-tabbed-admin`
- `sorl-thumbnail`
## Requirements
- Python 2.7, 3.4, 3.5, 3.6, 3.7
- Django 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1
- Django 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2
## Installation
- Run `pip install django-admin-interface`
+3 -2
View File
@@ -18,8 +18,9 @@ Features
- List filter dropdown *(optional)*
- ``NEW`` **Related modal** (instead of the old popup window, optional)
- ``NEW`` **Environment name/marker**
- Style optimizations for:
- Compatibility / Style optimizations for:
- `django-ckeditor`
- `django-dynamic-raw-id`
- `django-modeltranslation`
- `django-tabbed-admin`
- `sorl-thumbnail`
@@ -28,7 +29,7 @@ Requirements
------------
- Python 2.7, 3.4, 3.5, 3.6, 3.7
- Django 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1
- Django 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1, 2.2
Installation
------------
+2
View File
@@ -10,6 +10,8 @@ class ThemeAdmin(admin.ModelAdmin):
list_display = ('name', 'active', )
list_editable = ('active', )
list_per_page = 100
show_full_result_count = False
fieldsets = (
(None, {
+20
View File
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.cache import cache, caches
def app_cache():
return caches['admin_interface'] if 'admin_interface' in settings.CACHES else cache
def del_cached_active_theme():
app_cache().delete('admin_interface_theme')
def get_cached_active_theme():
return app_cache().get('admin_interface_theme', None)
def set_cached_active_theme(theme):
app_cache().set('admin_interface_theme', theme)
Binary file not shown.
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-20 16:12+0000\n"
"POT-Creation-Date: 2019-03-20 14:12-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -58,11 +58,11 @@ msgstr "Boutons supprimer"
msgid "Related Modal"
msgstr "Modale pour objet reliés"
#: admin_interface/admin.py:99
#: admin_interface/admin.py:100
msgid "List Filter"
msgstr "Filtre de liste"
#: admin_interface/admin.py:103
#: admin_interface/admin.py:104
msgid "Recent Actions"
msgstr "Actions récentes"
@@ -90,10 +90,8 @@ msgstr "titre"
#: admin_interface/models.py:71 admin_interface/models.py:86
#: admin_interface/models.py:106
#, fuzzy
#| msgid "logo color"
msgid "color"
msgstr "couleur du logo"
msgstr "couleur"
#: admin_interface/models.py:74 admin_interface/models.py:89
#: admin_interface/models.py:260
@@ -121,14 +119,16 @@ msgid ""
"(red: #E74C3C, orange: #E67E22, yellow: #F1C40F, green: #2ECC71, blue: "
"#3498DB)"
msgstr ""
"(rouge: #E74C3C, orange: #E67E22, jaune: #F1C40F, vert: #2ECC71, bleu: "
"#3498DB)"
#: admin_interface/models.py:109
msgid "visible in header (marker and name)"
msgstr ""
msgstr "visible dans len-tête (marqueur et nom)"
#: admin_interface/models.py:112
msgid "visible in favicon (marker)"
msgstr ""
msgstr "visible dans la favicon (marqueur)"
#: admin_interface/models.py:119 admin_interface/models.py:144
#: admin_interface/models.py:185 admin_interface/models.py:204
@@ -166,7 +166,7 @@ msgstr "opacité de l'arrière-plan"
#: admin_interface/models.py:253
msgid "close button visible"
msgstr ""
msgstr "bouton fermer visible"
#: admin_interface/models.py:257
msgid "use dropdown"
Binary file not shown.
@@ -69,7 +69,7 @@ msgstr "Azioni recenti"
#: admin_interface/apps.py:11
msgid "Admin Interface"
msgstr "Interfaccia di admin"
msgstr "Interfaccia di amministrazione"
#: admin_interface/models.py:56 admin_interface/models.py:100
msgid "name"
@@ -12,7 +12,11 @@ class Migration(migrations.Migration):
]
operations = [
migrations.AlterField(
migrations.RemoveField(
model_name='theme',
name='related_modal_background_opacity'
),
migrations.AddField(
model_name='theme',
name='related_modal_background_opacity',
field=models.CharField(
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('admin_interface', '0013_add_related_modal_close_button'),
]
operations = [
migrations.AlterField(
model_name='theme',
name='name',
field=models.CharField(default='Django', max_length=50, unique=True, verbose_name='name'),
),
]
+18 -1
View File
@@ -3,30 +3,45 @@
from __future__ import unicode_literals
from django.db import models
from django.db.models.signals import post_delete, post_save
from django.db.models.signals import post_delete, post_save, pre_save
from django.utils.encoding import python_2_unicode_compatible, force_text
from django.utils.translation import ugettext_lazy as _
from colorfield.fields import ColorField
from admin_interface.cache import del_cached_active_theme
@python_2_unicode_compatible
class Theme(models.Model):
@staticmethod
def post_migrate_handler(**kwargs):
del_cached_active_theme()
Theme.get_active_theme()
@staticmethod
def post_delete_handler(**kwargs):
del_cached_active_theme()
Theme.get_active_theme()
@staticmethod
def post_save_handler(instance, **kwargs):
del_cached_active_theme()
if instance.active:
Theme.objects.exclude(pk=instance.pk).update(active=False)
Theme.get_active_theme()
@staticmethod
def pre_save_handler(instance, **kwargs):
if instance.pk is None:
try:
obj = Theme.objects.get(name=instance.name)
if obj:
instance.pk = obj.pk
except Theme.DoesNotExist:
pass
@staticmethod
def get_active_theme():
objs_manager = Theme.objects
@@ -51,6 +66,7 @@ class Theme(models.Model):
return obj
name = models.CharField(
unique=True,
max_length=50,
default='Django',
verbose_name=_('name'))
@@ -275,3 +291,4 @@ class Theme(models.Model):
post_delete.connect(Theme.post_delete_handler, sender=Theme)
post_save.connect(Theme.post_save_handler, sender=Theme)
pre_save.connect(Theme.pre_save_handler, sender=Theme)
@@ -78,12 +78,10 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
}
// build the iframe html
var iframeHTML = '<div class="related-modal-iframe-container">' +
'<iframe id="related-modal-iframe" name="' + iframeName + '" src="' + iframeSrc + '"></iframe>' +
'</div>';
// create the iframe jquery element
var iframeEl = $(iframeHTML);
var iframeHTML = '<iframe id="related-modal-iframe" name="' + iframeName + '" src="' + iframeSrc + '"></iframe>';
var modalHTML = '<div class="related-modal-iframe-container">' + iframeHTML + '</div>';
var modalEl = $(modalHTML);
var iframeEl = modalEl.find('#related-modal-iframe');
if (e.data.lookup === true)
{
@@ -111,7 +109,7 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
showCloseBtn: true,
closeBtnInside: true,
items: {
src: iframeEl,
src: modalEl,
type: 'inline'
}
});
@@ -120,17 +118,31 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
}
// listen click events on related links
function presentRelatedObjectModalOnClickOn(selector, lookup) {
var data = {
lookup:(lookup === true ? true : false)
};
var el = $(selector);
el.removeAttr('onclick');
el.unbind('click');
el.click(data, presentRelatedObjectModal);
}
// django 1.7 compatibility
$('a.add-another').removeAttr('onclick');
$('a.add-another').click({ lookup:false }, presentRelatedObjectModal);
// $('a.add-another').removeAttr('onclick').click({ lookup:false }, presentRelatedObjectModal);
presentRelatedObjectModalOnClickOn('a.add-another');
// django 1.8 and above
$('a.related-widget-wrapper-link').click({ lookup:false }, presentRelatedObjectModal);
// $('a.related-widget-wrapper-link').click({ lookup:false }, presentRelatedObjectModal);
presentRelatedObjectModalOnClickOn('a.related-widget-wrapper-link');
// raw_id_fields support
$('a.related-lookup').unbind('click');
$('a.related-lookup').click({ lookup:true }, presentRelatedObjectModal);
// $('a.related-lookup').unbind('click').click({ lookup:true }, presentRelatedObjectModal);
presentRelatedObjectModalOnClickOn('a.related-lookup', true);
// django-dynamic-raw-id support - #61
// https://github.com/lincolnloop/django-dynamic-raw-id
presentRelatedObjectModalOnClickOn('a.dynamic_raw_id-related-lookup', true);
});
})(django.jQuery);
@@ -64,5 +64,5 @@ https://github.com/fabiocaccamo/django-admin-interface
{% block welcome-msg %}
{% get_admin_interface_theme as theme %}
{% if theme.env_visible_in_header %}<span class="enviroment-label {{ theme.env_name }}"></span> - {% endif %}{{ block.super }}<br>
{% endblock %}
{% if theme.env_visible_in_header %}<span class="environment-label {{ theme.env_name }}"></span> - {% endif %}{{ block.super }}<br>
{% endblock %}
@@ -3,10 +3,10 @@
color: {{ theme.css_header_text_color }};
}
.admin-interface .enviroment-label {
.admin-interface .environment-label {
}
.admin-interface .enviroment-label::before {
.admin-interface .environment-label::before {
content: "";
display: inline-block;
width: 8px;
@@ -19,7 +19,7 @@
-webkit-box-sizing: border-box;
}
.admin-interface .enviroment-label::after {
.admin-interface .environment-label::after {
content: "{{ theme.env_name }}";
}
@@ -254,4 +254,4 @@
{% if theme.css_module_rounded_corners %}
border-radius:4px;
{% endif %}
}
}
@@ -2,6 +2,7 @@
from django import template, VERSION
from admin_interface.cache import get_cached_active_theme, set_cached_active_theme
from admin_interface.models import Theme
from admin_interface.version import __version__
@@ -15,18 +16,10 @@ else:
@simple_tag(takes_context=True)
def get_admin_interface_theme(context):
theme = None
request = context.get('request', None)
if request:
theme = getattr(request, 'admin_interface_theme', None)
theme = get_cached_active_theme()
if not theme:
theme = Theme.get_active_theme()
if request:
request.admin_interface_theme = theme
set_cached_active_theme(theme)
return theme
+1 -1
View File
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
__version__ = '0.10.0'
__version__ = '0.10.5'
+1
View File
@@ -47,6 +47,7 @@ setup(
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
+46
View File
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
from django.core.management import call_command
from django.test import TestCase
from admin_interface.models import Theme
class AdminInterfaceFixturesTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def __load_theme(self, theme_name):
call_command('loaddata', 'admin_interface_theme_%s.json' % (theme_name, ))
def test_import_all(self):
self.__load_theme('django')
self.__load_theme('bootstrap')
self.__load_theme('foundation')
self.__load_theme('uswds')
self.assertEqual(Theme.objects.count(), 4);
def test_import_idempotency(self):
self.__load_theme('django')
self.__load_theme('django')
self.__load_theme('django')
self.__load_theme('django')
self.__load_theme('django')
self.assertEqual(Theme.objects.count(), 1);
self.__load_theme('bootstrap')
self.__load_theme('bootstrap')
self.__load_theme('bootstrap')
self.assertEqual(Theme.objects.count(), 2);
def test_import_override(self):
obj1 = Theme.get_active_theme()
obj1.title = 'Custom 1'
obj1.save()
self.__load_theme('django')
obj2 = Theme.get_active_theme()
self.assertEqual(obj1.pk, obj2.pk)
self.assertTrue(obj1.title != obj2.title)
+4 -3
View File
@@ -2,9 +2,9 @@
envlist =
py27-{dj17,dj18,dj19,dj110,dj111}-{sqlite,postgres},
py34-{dj17,dj18,dj19,dj110,dj111,dj20}-{sqlite,postgres},
py35-{dj18,dj19,dj110,dj111,dj20,dj21}-{sqlite,postgres},
py36-{dj18,dj19,dj110,dj111,dj20,dj21,djmaster}-{sqlite,postgres},
py37-{dj20,dj21,djmaster}-{sqlite,postgres},
py35-{dj18,dj19,dj110,dj111,dj20,dj21,dj22}-{sqlite,postgres},
py36-{dj18,dj19,dj110,dj111,dj20,dj21,dj22,djmaster}-{sqlite,postgres},
py37-{dj20,dj21,dj22,djmaster}-{sqlite,postgres},
[testenv]
passenv = CI TRAVIS TRAVIS_*
deps =
@@ -15,6 +15,7 @@ deps =
dj111: Django >= 1.11, < 1.12
dj20: Django >= 2.0, < 2.1
dj21: Django >= 2.1, < 2.2
dj22: Django >= 2.2, < 2.3
djmaster: https://github.com/django/django/archive/master.tar.gz
# mysql: mysqlclient
postgres: psycopg2-binary