Commit 5793b2cc authored by Joern jkuensem's avatar Joern jkuensem

Task LEI-30: Adapted functional scheduling model tests to reflect model changes

parent 5c96eda7
......@@ -4247,7 +4247,7 @@ SAS/LSMR/src/lsmr/lsmrapp/__init__.py -text
SAS/LSMR/src/lsmr/lsmrapp/admin.py -text
SAS/LSMR/src/lsmr/lsmrapp/apps.py -text
SAS/LSMR/src/lsmr/lsmrapp/migrations/0001_initial.py -text
SAS/LSMR/src/lsmr/lsmrapp/migrations/0002_auto_20190412_1719.py -text
SAS/LSMR/src/lsmr/lsmrapp/migrations/0002_auto_20190417_1025.py -text
SAS/LSMR/src/lsmr/lsmrapp/migrations/0003_populate.py -text
SAS/LSMR/src/lsmr/lsmrapp/migrations/CMakeLists.txt -text
SAS/LSMR/src/lsmr/lsmrapp/migrations/__init__.py -text
......
# Generated by Django 2.0.6 on 2019-04-12 17:19
# Generated by Django 2.0.6 on 2019-04-17 10:25
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
......
......@@ -6,7 +6,7 @@ from ..populate import *
class Migration(migrations.Migration):
dependencies = [
('lsmrapp', '0002_auto_20190412_1719'),
('lsmrapp', '0002_auto_20190417_1025'),
]
operations = [ migrations.RunPython(populate_choices) ]
......@@ -139,14 +139,6 @@ class Subtask(BasicCommon):
# resource_claim = ForeignKey("ResourceClaim", null=False, on_delete=PROTECT) # todo <-- how is this external reference supposed to work?
# class DataproductRelation(BasicCommon):
# task = ForeignKey('Subtask', null=False, on_delete=CASCADE)
# input = ForeignKey('Dataproduct', related_name='inputs_dataproduct_relation', null=True, on_delete=SET_NULL)
# output = ForeignKey('Dataproduct', related_name='outputs_dataproduct_relation', null=True, on_delete=SET_NULL)
# input_role = ForeignKey('SubtaskConnector', related_name='input_roles_dataproduct_relation', null=True, on_delete=SET_NULL)
# output_role = ForeignKey('SubtaskConnector', related_name='output_roles_dataproduct_relation', null=True, on_delete=SET_NULL)
class SubtaskInput(BasicCommon):
subtask = ForeignKey('Subtask', null=False, on_delete=CASCADE)
task_relation_blueprint = ForeignKey('TaskRelationBlueprint', null=True, on_delete=SET_NULL)
......
......@@ -74,7 +74,7 @@ class SubtaskInputSelectionTemplateSerializer(serializers.HyperlinkedModelSerial
class DataproductFeedbackTemplateSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.SubtaskInputSelectionTemplate
model = models.DataproductFeedbackTemplate
fields = '__all__'
......@@ -84,11 +84,6 @@ class SubtaskSerializer(serializers.HyperlinkedModelSerializer):
fields = '__all__'
# class DataproductRelationSerializer(serializers.HyperlinkedModelSerializer):
# class Meta:
# model = models.DataproductRelation
# fields = '__all__'
class SubtaskInputSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.SubtaskInput
......
......@@ -72,10 +72,6 @@ class SubtaskViewSet(viewsets.ModelViewSet):
serializer_class = serializers.SubtaskSerializer
# class DataproductRelationViewSet(viewsets.ModelViewSet):
# queryset = models.DataproductRelation.objects.all()
# serializer_class = serializers.DataproductRelationSerializer
class SubtaskInputViewSet(viewsets.ModelViewSet):
queryset = models.SubtaskInput.objects.all()
serializer_class = serializers.SubtaskInputSerializer
......
......@@ -211,7 +211,7 @@ class SubtaskInputSelectionTemplateTest(rest_framework.test.APITransactionTestCa
"schema": {"myotherkey": "my other value"},
"tags": []}
# This adds nothing on top of the template base class, so nothing new to test here.
# This currently adds nothing on top of the template base class, so nothing new to test here.
class DataproductFeedbackTemplateTest(rest_framework.test.APITransactionTestCase):
......@@ -237,7 +237,7 @@ class DataproductFeedbackTemplateTest(rest_framework.test.APITransactionTestCase
"schema": {"myotherkey": "my other value"},
"tags": []}
# This adds nothing on top of the template base class, so nothing new to test here.
# This currently adds nothing on top of the template base class, so nothing new to test here.
class SubtaskOutputTest(rest_framework.test.APITransactionTestCase):
......
......@@ -3,4 +3,5 @@
. test_funcs.sh
setup_with_test_lsmr
sleep 5
run_test ./t_lsmrapp_scheduling_functional.py
......@@ -69,6 +69,8 @@ def _call_API_and_assert_expected_response(self, url, call, data, expected_code,
self.assertEqual(response.status_code, expected_code)
r_dict = json.loads(response.content.decode('utf-8'))
for key, value in expected_content.items():
if key not in r_dict.keys():
print('!!! Missing key: %s' % key)
self.assertTrue(key in r_dict.keys())
if type(value) is list:
self.assertEqual(sorted(value), sorted(r_dict[key])) # compare lists independent of ordering
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment