From 22afccd29426886f8fc2f85b125444cee73c84ca Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 5 May 2019 00:21:54 +1000 Subject: [PATCH] Add tests for the custom templates --- InvenTree/part/test_part.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/test_part.py b/InvenTree/part/test_part.py index 1214f2fc57..486d7c5684 100644 --- a/InvenTree/part/test_part.py +++ b/InvenTree/part/test_part.py @@ -4,9 +4,27 @@ import os from .models import Part from .models import rename_part_image +from .templatetags import inventree_extras -class SimplePartTest(TestCase): +class TemplateTagTest(TestCase): + """ Tests for the custom template tag code """ + + def test_multiply(self): + self.assertEqual(inventree_extras.multiply(3, 5), 15) + + def test_version(self): + self.assertEqual(type(inventree_extras.inventree_version()), str) + + def test_hash(self): + hash = inventree_extras.inventree_commit() + self.assertEqual(len(hash), 7) + + def test_github(self): + self.assertIn('github.com', inventree_extras.inventree_github()) + + +class PartTest(TestCase): """ Tests for the Part model """ fixtures = [