aa-intel-tool 2.6.3__py3-none-any.whl → 2.7.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_intel_tool/__init__.py +1 -1
- aa_intel_tool/constants.py +0 -17
- aa_intel_tool/exceptions.py +14 -4
- aa_intel_tool/locale/cs_CZ/LC_MESSAGES/django.po +15 -12
- aa_intel_tool/locale/de/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/de/LC_MESSAGES/django.po +17 -14
- aa_intel_tool/locale/django.pot +16 -13
- aa_intel_tool/locale/es/LC_MESSAGES/django.po +17 -12
- aa_intel_tool/locale/fr_FR/LC_MESSAGES/django.po +15 -12
- aa_intel_tool/locale/it_IT/LC_MESSAGES/django.po +15 -12
- aa_intel_tool/locale/ja/LC_MESSAGES/django.po +17 -12
- aa_intel_tool/locale/ko_KR/LC_MESSAGES/django.po +17 -12
- aa_intel_tool/locale/nl_NL/LC_MESSAGES/django.po +15 -12
- aa_intel_tool/locale/pl_PL/LC_MESSAGES/django.po +15 -12
- aa_intel_tool/locale/ru/LC_MESSAGES/django.po +17 -12
- aa_intel_tool/locale/sk/LC_MESSAGES/django.po +15 -12
- aa_intel_tool/locale/uk/LC_MESSAGES/django.mo +0 -0
- aa_intel_tool/locale/uk/LC_MESSAGES/django.po +20 -21
- aa_intel_tool/locale/zh_Hans/LC_MESSAGES/django.po +17 -12
- aa_intel_tool/parser/general.py +5 -3
- aa_intel_tool/parser/module/chatlist.py +6 -4
- aa_intel_tool/parser/module/dscan.py +1 -1
- aa_intel_tool/parser/module/fleetcomp.py +1 -1
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-highlight-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-chatscan-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-css.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-highlight-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-dscan-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-fleetcomp-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-fleetcomposition-highlight-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/bundles/aa-intel-tool-scan-result-common-js.html +2 -2
- aa_intel_tool/templates/aa_intel_tool/views/index.html +0 -7
- aa_intel_tool/tests/test_access.py +1 -7
- aa_intel_tool/tests/test_auth_hooks.py +1 -7
- {aa_intel_tool-2.6.3.dist-info → aa_intel_tool-2.7.1.dist-info}/METADATA +1 -1
- {aa_intel_tool-2.6.3.dist-info → aa_intel_tool-2.7.1.dist-info}/RECORD +39 -43
- aa_intel_tool/helper/static_files.py +0 -42
- aa_intel_tool/templatetags/__init__.py +0 -3
- aa_intel_tool/templatetags/aa_intel_tool.py +0 -88
- aa_intel_tool/tests/test_templatetags.py +0 -103
- {aa_intel_tool-2.6.3.dist-info → aa_intel_tool-2.7.1.dist-info}/WHEEL +0 -0
- {aa_intel_tool-2.6.3.dist-info → aa_intel_tool-2.7.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Tests for the template tags
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
# Django
|
|
6
|
-
from django.template import Context, Template
|
|
7
|
-
from django.test import TestCase, override_settings
|
|
8
|
-
|
|
9
|
-
# AA Intel Tool
|
|
10
|
-
from aa_intel_tool import __version__
|
|
11
|
-
from aa_intel_tool.constants import PACKAGE_NAME
|
|
12
|
-
from aa_intel_tool.helper.static_files import calculate_integrity_hash
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class TestVersionedStatic(TestCase):
|
|
16
|
-
"""
|
|
17
|
-
Tests for aa_intel_tool template tag
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
@override_settings(DEBUG=False)
|
|
21
|
-
def test_versioned_static(self):
|
|
22
|
-
"""
|
|
23
|
-
Test should return static URL string with a version
|
|
24
|
-
:return:
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
context = Context(dict_={"version": __version__})
|
|
28
|
-
|
|
29
|
-
template_to_render = Template(
|
|
30
|
-
template_string=(
|
|
31
|
-
"{% load aa_intel_tool %}"
|
|
32
|
-
"{% aa_intel_tool_static 'css/aa-intel-tool.min.css' %}"
|
|
33
|
-
"{% aa_intel_tool_static 'javascript/aa-intel-tool.min.js' %}"
|
|
34
|
-
)
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
rendered_template = template_to_render.render(context=context)
|
|
38
|
-
|
|
39
|
-
expected_static_css_src = (
|
|
40
|
-
f'/static/{PACKAGE_NAME}/css/aa-intel-tool.min.css?v={context["version"]}'
|
|
41
|
-
)
|
|
42
|
-
expected_static_css_src_integrity = calculate_integrity_hash(
|
|
43
|
-
"css/aa-intel-tool.min.css"
|
|
44
|
-
)
|
|
45
|
-
expected_static_js_src = f'/static/{PACKAGE_NAME}/javascript/aa-intel-tool.min.js?v={context["version"]}'
|
|
46
|
-
expected_static_js_src_integrity = calculate_integrity_hash(
|
|
47
|
-
"javascript/aa-intel-tool.min.js"
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
self.assertIn(member=expected_static_css_src, container=rendered_template)
|
|
51
|
-
self.assertIn(
|
|
52
|
-
member=expected_static_css_src_integrity, container=rendered_template
|
|
53
|
-
)
|
|
54
|
-
self.assertIn(member=expected_static_js_src, container=rendered_template)
|
|
55
|
-
self.assertIn(
|
|
56
|
-
member=expected_static_js_src_integrity, container=rendered_template
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
@override_settings(DEBUG=True)
|
|
60
|
-
def test_versioned_static_with_debug_enabled(self) -> None:
|
|
61
|
-
"""
|
|
62
|
-
Test versioned static template tag with DEBUG enabled
|
|
63
|
-
|
|
64
|
-
:return:
|
|
65
|
-
:rtype:
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
context = Context({"version": __version__})
|
|
69
|
-
template_to_render = Template(
|
|
70
|
-
template_string=(
|
|
71
|
-
"{% load aa_intel_tool %}"
|
|
72
|
-
"{% aa_intel_tool_static 'css/aa-intel-tool.min.css' %}"
|
|
73
|
-
)
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
rendered_template = template_to_render.render(context=context)
|
|
77
|
-
|
|
78
|
-
expected_static_css_src = (
|
|
79
|
-
f'/static/{PACKAGE_NAME}/css/aa-intel-tool.min.css?v={context["version"]}'
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
self.assertIn(member=expected_static_css_src, container=rendered_template)
|
|
83
|
-
self.assertNotIn(member="integrity=", container=rendered_template)
|
|
84
|
-
|
|
85
|
-
@override_settings(DEBUG=False)
|
|
86
|
-
def test_invalid_file_type(self) -> None:
|
|
87
|
-
"""
|
|
88
|
-
Test should raise a ValueError for an invalid file type
|
|
89
|
-
|
|
90
|
-
:return:
|
|
91
|
-
:rtype:
|
|
92
|
-
"""
|
|
93
|
-
|
|
94
|
-
context = Context({"version": __version__})
|
|
95
|
-
template_to_render = Template(
|
|
96
|
-
template_string=(
|
|
97
|
-
"{% load aa_intel_tool %}"
|
|
98
|
-
"{% aa_intel_tool_static 'invalid/invalid.txt' %}"
|
|
99
|
-
)
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
with self.assertRaises(ValueError):
|
|
103
|
-
template_to_render.render(context=context)
|
|
File without changes
|
|
File without changes
|