@@ -0,0 +1,2316 @@
+# pylint: disable=missing-docstring%0Afrom __future__ import absolute_import, division, print_function, unicode_literals%0A%0Aimport os%0Aimport shutil%0A%0Afrom django import template%0Afrom django.conf import settings%0Afrom django.contrib.auth import get_user_model%0Afrom django.test import TestCase%0A%0Afrom resolwe.flow.managers import manager%0Afrom resolwe.flow.models import Process, Data%0A%0A%0Aclass ProcessFieldsTagsTest(TestCase):%0A    def setUp(self):%0A        User = get_user_model()%0A        self.contributor = User.objects.create_user('test_user', 'test_pwd')%0A%0A    def tearDown(self):%0A        for data in Data.objects.all():%0A            data_dir = os.path.join(settings.FLOW_EXECUTOR%5B'DATA_DIR'%5D, str(data.id))%0A            shutil.rmtree(data_dir, ignore_errors=True)%0A%0A    def test_templatetags(self):%0A        input_process = Process.objects.create(%0A            name='Input process',%0A            contributor=self.contributor,%0A            type='data:test:inputobject:',%0A        )%0A        input_data = Data.objects.create(%0A            name='Input Data object',%0A            contributor=self.contributor,%0A            process=input_process,%0A        )%0A%0A        process = Process.objects.create(%0A            name='Test template tags',%0A            contributor=self.contributor,%0A            type='test:data:templatetags:',%0A            input_schema=%5B%0A                %7B'name': 'input_data', 'type': 'data:test:inputobject:'%7D,%0A            %5D,%0A            output_schema=%5B%0A                %7B'name': 'name', 'type': 'basic:string:'%7D,%0A                %7B'name': 'id', 'type': 'basic:integer:'%7D,%0A                %7B'name': 'type', 'type': 'basic:string:'%7D,%0A            %5D,%0A            run=%7B%0A                'bash': %22%22%22%0Are-save name %22%7B%7B input_data %7C name %7D%7D%22%0Are-save id %7B%7B input_data %7C id %7D%7D%0Are-save type %7B%7B input_data %7C type %7D%7D%0A%22%22%22%0A            %7D%0A%0A        )%0A        data = Data.objects.create(%0A            name='Data object',%0A            contributor=self.contributor,%0A            process=process,%0A            input=%7B'input_data': input_data.pk%7D,%0A        )%0A%0A        manager.communicate(verbosity=0)%0A%0A        # update output%0A        data = Data.objects.get(pk=data.pk)%0A%0A        self.assertEqual(data.output%5B'name'%5D, input_data.name)%0A        self.assertEqual(data.output%5B'id'%5D, input_data.pk)%0A        self.assertEqual(data.output%5B'type'%5D, input_process.type)%0A

Add test for templatetags