diff --git a/api/pytest/test_api_tester.py b/api/pytest/test_api_tester.py index a4af3f5..6350ec8 100644 --- a/api/pytest/test_api_tester.py +++ b/api/pytest/test_api_tester.py @@ -87,16 +87,15 @@ def test_ECNQueue_Item(): "department", "building", "dateReceived", - "jsonData" + "jsonData", + "toJson" ] - # Returns a list of all attributes in the item object - returnedItemKeys = item.__dict__ + # Returns a list of all attributes in the item object, omiting attribute names starting with "_" + returnedItemKeys = [] + for attribute in item.__dir__(): + if not attribute.startswith("_"): + returnedItemKeys.append(attribute) - # Checks that all necessary keys are in the item + # Checks that all necessary keys are in the item by comparing it to the itemkeys list assert all(keys in itemKeys for keys in returnedItemKeys) - - print() - -if __name__ == "__main__": - test_ECNQueue_Item() \ No newline at end of file