mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 03:30:54 +00:00
Adds a report template tag for dict access (#3905)
* Adds a report template tag for dict access (cherry picked from commit 7df2f0f878e312a6f94a2c24304643cde91012de) * Add unit test for new template tag
This commit is contained in:
@ -29,6 +29,19 @@ class ReportTagTest(TestCase):
|
||||
"""Enable or disable debug mode for reports"""
|
||||
InvenTreeSetting.set_setting('REPORT_DEBUG_MODE', value, change_user=None)
|
||||
|
||||
def test_getkey(self):
|
||||
"""Tests for the 'getkey' template tag"""
|
||||
|
||||
data = {
|
||||
'hello': 'world',
|
||||
'foo': 'bar',
|
||||
'with spaces': 'withoutspaces',
|
||||
1: 2,
|
||||
}
|
||||
|
||||
for k, v in data.items():
|
||||
self.assertEqual(report_tags.getkey(data, k), v)
|
||||
|
||||
def test_asset(self):
|
||||
"""Tests for asset files"""
|
||||
|
||||
|
Reference in New Issue
Block a user