minor cleanups (#225)

* use normal html self-closing tags

* stop using obsolete test integration

* make test more straightforward

* removed unused setting
master
Éric 2022-12-11 16:53:05 -05:00 committed by GitHub
parent 19cbeead58
commit 15da0bfd9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 21 deletions

View File

@ -106,7 +106,7 @@ jobs:
env: env:
DATABASE_ENGINE: ${{ matrix.database }} DATABASE_ENGINE: ${{ matrix.database }}
run: | run: |
coverage run --append --source=admin_interface setup.py test coverage run --append --source=admin_interface runtests.py
coverage xml -o ./coverage.xml coverage xml -o ./coverage.xml
- name: Upload coverage to Codecov - name: Upload coverage to Codecov

View File

@ -1808,7 +1808,7 @@
_mfpTrigger('LazyLoad', item); _mfpTrigger('LazyLoad', item);
if(item.type === 'image') { if(item.type === 'image') {
item.img = $('<img class="mfp-img" />').on('load.mfploader', function() { item.img = $('<img class="mfp-img">').on('load.mfploader', function() {
item.hasSize = true; item.hasSize = true;
}).on('error.mfploader', function() { }).on('error.mfploader', function() {
item.hasSize = true; item.hasSize = true;

View File

@ -92,33 +92,33 @@
href="{% static 'admin_interface/css/rangefilter.css' %}?v={{ version_md5_cache }}"> href="{% static 'admin_interface/css/rangefilter.css' %}?v={{ version_md5_cache }}">
{% if not theme.recent_actions_visible %} {% if not theme.recent_actions_visible %}
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/recent-actions.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/recent-actions.css' %}?v={{ version_md5_cache }}">
{% endif %} {% endif %}
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/related-modal.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/related-modal.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/streamfield.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/streamfield.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/jquery.ui.tabs.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/jquery.ui.tabs.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/modeltranslation.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/modeltranslation.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/sorl-thumbnail.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/sorl-thumbnail.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/ckeditor.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/ckeditor.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/tinymce.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/tinymce.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/json-widget.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/json-widget.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/import-export.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/import-export.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/rtl.css' %}?v={{ version_md5_cache }}"/> href="{% static 'admin_interface/css/rtl.css' %}?v={{ version_md5_cache }}">
<link rel="stylesheet" type="text/css" <link rel="stylesheet" type="text/css"
href="{% static 'admin_interface/css/tabbed-changeform.css' %}?v={{ version_md5_cache }}"> href="{% static 'admin_interface/css/tabbed-changeform.css' %}?v={{ version_md5_cache }}">
{% if current_lang == 'fa' %} {% if current_lang == 'fa' %}
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v27.2.2/dist/font-face.css" /> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v27.2.2/dist/font-face.css">
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -12,8 +12,9 @@ def runtests():
TestRunner = get_runner(settings) TestRunner = get_runner(settings)
test_runner = TestRunner() test_runner = TestRunner()
failures = test_runner.run_tests(["tests"]) failures = test_runner.run_tests(["tests"])
sys.exit(bool(failures)) return failures
if __name__ == "__main__": if __name__ == "__main__":
runtests() failures = runtests()
sys.exit(bool(failures))

View File

@ -80,5 +80,4 @@ setup(
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Build Tools",
], ],
test_suite="runtests.runtests",
) )

View File

@ -89,7 +89,7 @@ class AdminInterfaceModelsTestCase(TestCase):
def test_str(self): def test_str(self):
theme = Theme.get_active_theme() theme = Theme.get_active_theme()
self.assertEqual(f"{theme}", "Django") self.assertEqual(str(theme), "Django")
# class AdminInterfaceModelsMultiDBTestCase(TestCase): # class AdminInterfaceModelsMultiDBTestCase(TestCase):

View File

@ -13,7 +13,6 @@ python =
3.11: py311 3.11: py311
[testenv] [testenv]
passenv = CI,GITHUB_WORKFLOW
deps = deps =
dj22: Django == 2.2.* dj22: Django == 2.2.*
dj30: Django == 3.0.* dj30: Django == 3.0.*
@ -30,7 +29,7 @@ setenv =
# mysql: DATABASE_ENGINE=mysql # mysql: DATABASE_ENGINE=mysql
postgres: DATABASE_ENGINE=postgres postgres: DATABASE_ENGINE=postgres
commands = commands =
coverage run --append --source=admin_interface setup.py test coverage run --append --source=admin_interface runtests.py
coverage report -m coverage report -m
codecov codecov