Skip to content

Commit

Permalink
readd attribute is_instance_json_regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-muchiri committed Feb 16, 2024
1 parent b569f4c commit c755de8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 11 additions & 5 deletions onadata/apps/api/tests/viewsets/test_xform_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2523,6 +2523,7 @@ def test_xform_serializer_none(self):
"instances_with_geopoints": False,
"has_hxl_support": False,
"hash": "",
"is_instance_json_regenerated": False,
"contributes_entities_to": None,
"consumes_entities_from": [],
}
Expand Down Expand Up @@ -5741,6 +5742,7 @@ def test_get_single_registration_form(self):
"last_updated_at": xform.last_updated_at.isoformat().replace("+00:00", "Z"),
"hash": xform.hash,
"is_merged_dataset": False,
"is_instance_json_regenerated": False,
"project": f"http://testserver/api/v1/projects/{xform.project.pk}",
}
self.assertEqual(json.dumps(response.data), json.dumps(expected_data))
Expand Down Expand Up @@ -5809,6 +5811,7 @@ def test_get_list_registration_form(self):
),
"hash": xform.hash,
"is_merged_dataset": False,
"is_instance_json_regenerated": False,
"project": f"http://testserver/api/v1/projects/{xform.project.pk}",
}
]
Expand All @@ -5819,9 +5822,7 @@ def test_get_single_follow_up_form(self):
"""Response a for an XForm consuming entities is correct"""
self._project_create()
entity_list = EntityList.objects.create(name="trees", project=self.project)
xform = self._publish_markdown(
self.follow_up_form_md, self.user, project=self.project
)
xform = self._publish_markdown(self.follow_up_form_md, self.user, self.project)
xform.refresh_from_db()
view = XFormViewSet.as_view({"get": "retrieve"})
request = self.factory.get("/", **self.extra)
Expand Down Expand Up @@ -5900,6 +5901,7 @@ def test_get_single_follow_up_form(self):
"last_updated_at": xform.last_updated_at.isoformat().replace("+00:00", "Z"),
"hash": xform.hash,
"is_merged_dataset": False,
"is_instance_json_regenerated": False,
"project": f"http://testserver/api/v1/projects/{xform.project.pk}",
}
self.assertEqual(response.data, expected_data)
Expand All @@ -5908,7 +5910,10 @@ def test_get_single_follow_up_form(self):
def test_get_list_follow_up_form(self):
"""Getting a list of follow up forms is correct"""
# Publish registration form
xform = self._publish_markdown(self.follow_up_form_md, self.user)
self._project_create()
entity_list = EntityList.objects.create(name="trees", project=self.project)
xform = self._publish_markdown(self.follow_up_form_md, self.user, self.project)
xform.refresh_from_db()
view = XFormViewSet.as_view({"get": "list"})
request = self.factory.get("/", **self.extra)
response = view(request)
Expand Down Expand Up @@ -5970,10 +5975,11 @@ def test_get_list_follow_up_form(self):
),
"hash": xform.hash,
"is_merged_dataset": False,
"is_instance_json_regenerated": False,
"project": f"http://testserver/api/v1/projects/{xform.project.pk}",
}
]
self.assertEqual(response.data, expected_data)
self.assertEqual(json.dumps(response.data), json.dumps(expected_data))


class ExportAsyncTestCase(XFormViewSetBaseTestCase):
Expand Down
2 changes: 0 additions & 2 deletions onadata/libs/serializers/xform_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ class Meta:
"shared_data",
"deleted_at",
"deleted_by",
"is_instance_json_regenerated",
)


Expand Down Expand Up @@ -520,7 +519,6 @@ class Meta:
"shared_data",
"deleted_at",
"deleted_by",
"is_instance_json_regenerated",
)

def get_metadata(self, obj):
Expand Down

0 comments on commit c755de8

Please sign in to comment.