Compare commits
3 Commits
features/f
...
features/q
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9340afd196 | ||
|
|
f97ccb693b | ||
|
|
c3b539ba19 |
@@ -233,6 +233,12 @@ and will exhaust the available Postgres connections available if a number
|
||||
other than 0 is used. Reference: https://serverfault.com/questions/635100/django-conn-max-age-persists-connections-but-doesnt-reuse-them-with-postgresq
|
||||
and https://github.com/benoitc/gunicorn/issues/996
|
||||
|
||||
``MAYAN_GUNICORN_TIMEOUT``
|
||||
|
||||
Optional. Changes the amount of time the frontend worker will wait for a
|
||||
request to finish before raising a timeout error. The default is 120
|
||||
seconds.
|
||||
|
||||
``MAYAN_GUNICORN_WORKERS``
|
||||
|
||||
Optional. This environment variable controls the number of frontend workers
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
QUnit.test('partialNavigation.filterLocation', function (assert) {
|
||||
var testPartialNavigation = new PartialNavigation({
|
||||
initialURL: '/testInitialURL',
|
||||
});
|
||||
|
||||
/*
|
||||
* For an empty newLocation we expect the fragment of the URL minus the
|
||||
* query
|
||||
*/
|
||||
var expected = new URI(new URI(location).fragment()).path().toString();
|
||||
assert.strictEqual(
|
||||
testPartialNavigation.filterLocation(''), expected, 'newLocation === ""');
|
||||
|
||||
/*
|
||||
* For an empty root value we expect initialURL passed to the
|
||||
* partialNavigation instance when initialized.
|
||||
*/
|
||||
assert.strictEqual(
|
||||
testPartialNavigation.filterLocation('/'), testPartialNavigation.initialURL, 'newLocation === "/"'
|
||||
);
|
||||
|
||||
/*
|
||||
* For an empty root value we expect initialURL passed to the
|
||||
* partialNavigation instance when initialized.
|
||||
*/
|
||||
assert.strictEqual(
|
||||
testPartialNavigation.filterLocation('random'), 'random', 'newLocation === "random"'
|
||||
);
|
||||
});
|
||||
@@ -38,6 +38,7 @@
|
||||
<script src="{% static 'appearance/node_modules/jquery/dist/jquery.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'appearance/node_modules/bootstrap/dist/js/bootstrap.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'appearance/node_modules/@fortawesome/fontawesome-free/js/all.min.js' %}" data-auto-replace-svg="nest" type="text/javascript"></script>
|
||||
{% block javascript %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
{% endspaceless %}
|
||||
|
||||
@@ -4,7 +4,12 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.dependencies.classes import (
|
||||
environment_build, environment_development, environment_testing,
|
||||
PythonDependency
|
||||
JavaScriptDependency, PythonDependency
|
||||
)
|
||||
|
||||
JavaScriptDependency(
|
||||
environment=environment_testing, label=_('QUnit'), module=__name__,
|
||||
name='qunit', version_string='=2.9.2'
|
||||
)
|
||||
|
||||
PythonDependency(
|
||||
|
||||
22
mayan/apps/common/templates/common/qunit.html
Normal file
22
mayan/apps/common/templates/common/qunit.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{% extends 'appearance/base.html' %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
{% block base_title %}{% trans 'Qunit' %}{% endblock %}
|
||||
|
||||
{% block project_name %}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link href="{% static 'common/node_modules/qunit/qunit/qunit.css' %}" media="screen" rel="stylesheet" type="text/css" />
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascript %}
|
||||
<script src="{% static 'common/node_modules/qunit/qunit/qunit.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'appearance/js/test/unit/partial_navigation.js' %}" type="text/javascript"></script>
|
||||
{% endblock %}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
TEST FILE SPECIAL CHARACTERS FILENAME
|
||||
@@ -11,6 +11,7 @@ TEST_VIEW_NAME = 'test view name'
|
||||
TEST_VIEW_URL = 'test-view-url'
|
||||
|
||||
# Filenames
|
||||
TEST_ARCHIVE_ZIP_SPECIAL_CHARACTERS_FILENAME_MEMBER = 'test_archvive_with_special_characters_filename_member.zip'
|
||||
TEST_FILENAME1 = 'test_file1.txt'
|
||||
TEST_FILENAME2 = 'test_file2.txt'
|
||||
TEST_FILENAME3 = 'test_file3.txt'
|
||||
@@ -23,6 +24,10 @@ TEST_ZIP_FILE = 'test_file.zip'
|
||||
TEST_COMPRESSED_FILE_CONTENTS = [TEST_FILENAME1, TEST_FILENAME2]
|
||||
|
||||
# File paths
|
||||
TEST_ARCHIVE_ZIP_SPECIAL_CHARACTERS_FILENAME_MEMBER_PATH = os.path.join(
|
||||
settings.BASE_DIR, 'apps', 'common', 'tests', 'contrib',
|
||||
TEST_ARCHIVE_ZIP_SPECIAL_CHARACTERS_FILENAME_MEMBER
|
||||
)
|
||||
TEST_FILE3_PATH = os.path.join(
|
||||
settings.BASE_DIR, 'apps', 'common', 'tests', 'contrib', TEST_FILENAME3
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ from mayan.apps.common.tests import BaseTestCase
|
||||
from ..compressed_files import Archive, TarArchive, ZipArchive
|
||||
|
||||
from .literals import (
|
||||
TEST_ARCHIVE_ZIP_SPECIAL_CHARACTERS_FILENAME_MEMBER_PATH,
|
||||
TEST_COMPRESSED_FILE_CONTENTS, TEST_FILE_CONTENTS_1, TEST_FILE3_PATH,
|
||||
TEST_FILENAME1, TEST_FILENAME3, TEST_TAR_BZ2_FILE_PATH,
|
||||
TEST_TAR_FILE_PATH, TEST_TAR_GZ_FILE_PATH, TEST_ZIP_FILE_PATH
|
||||
@@ -58,6 +59,11 @@ class ZipArchiveClassTestCase(TarArchiveClassTestCase):
|
||||
archive_path = TEST_ZIP_FILE_PATH
|
||||
cls = ZipArchive
|
||||
|
||||
def test_open_member_with_special_characters_filename(self):
|
||||
with open(TEST_ARCHIVE_ZIP_SPECIAL_CHARACTERS_FILENAME_MEMBER_PATH, mode='rb') as file_object:
|
||||
archive = Archive.open(file_object=file_object)
|
||||
list(archive.get_members())
|
||||
|
||||
|
||||
class TarGzArchiveClassTestCase(TarArchiveClassTestCase):
|
||||
archive_path = TEST_TAR_GZ_FILE_PATH
|
||||
@@ -67,3 +73,5 @@ class TarGzArchiveClassTestCase(TarArchiveClassTestCase):
|
||||
class TarBz2ArchiveClassTestCase(TarArchiveClassTestCase):
|
||||
archive_path = TEST_TAR_BZ2_FILE_PATH
|
||||
cls = TarArchive
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ from .views import (
|
||||
AboutView, CurrentUserLocaleProfileDetailsView,
|
||||
CurrentUserLocaleProfileEditView, FaviconRedirectView, HomeView,
|
||||
LicenseView, ObjectErrorLogEntryListClearView, ObjectErrorLogEntryListView,
|
||||
RootView, SetupListView, ToolsListView, multi_object_action_view
|
||||
RootView, SetupListView, ToolsListView, QUnitView,
|
||||
multi_object_action_view
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
@@ -43,6 +44,9 @@ urlpatterns = [
|
||||
view=ObjectErrorLogEntryListClearView.as_view(),
|
||||
name='object_error_list_clear'
|
||||
),
|
||||
url(
|
||||
regex=r'^qunit/', view=QUnitView.as_view(), name='qunit'
|
||||
)
|
||||
]
|
||||
|
||||
urlpatterns += [
|
||||
|
||||
@@ -276,3 +276,8 @@ def multi_object_action_view(request):
|
||||
action, urlencode({'id_list': id_list, 'next': next})
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class QUnitView(SimpleView):
|
||||
extra_context = {'title': _('QUnit tests')}
|
||||
template_name = 'common/qunit.html'
|
||||
|
||||
Reference in New Issue
Block a user