You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It fails because retrieved_app.meta contains found=True, which is not present on created_app. So, I decided to force them to be equal:
deftest_create_app_data_creates_new_data(self):
created_app=self.dao.create_app_data(
"test", ["permission1", "permission2"]
)
self.assertEqual(created_app.id, "test")
self.assertEqual(created_app.permissions, ["permission1", "permission2"])
retrieved_app=AppData.get(id=created_app.id)
# First attempt:created_app.meta["found"] =retrieved_app.meta["found"]
# Second attempt:created_app.meta=retrieved_app.meta# Third attempt:delretrieved_app.meta["found"]
# Fourth attempt:delretrieved_app.meta._d_["found"]
self.assertEqual(created_app, retrieved_app)
All four methods work when I have a breakpoint set in the test and run it in the IntelliJ debugger (the final self.assertEqual passes), but none of them work when run normally or in the debugger without any breakpoints set (the final self.assertEqual fails). Why is this, and how can I make this test work reliably?
I could change the return statement of create_app_data to call .get but I would prefer to avoid a (seemingly) redundant call, if possible.
I am using elasticsearch-dsl 8.17.1.
The text was updated successfully, but these errors were encountered:
I have the following model:
These documents are created in this method:
And the code works fine, but integration tests fail when I check equality between created objects and retrieved objects:
It fails because
retrieved_app.meta
containsfound=True
, which is not present oncreated_app
. So, I decided to force them to be equal:All four methods work when I have a breakpoint set in the test and run it in the IntelliJ debugger (the final
self.assertEqual
passes), but none of them work when run normally or in the debugger without any breakpoints set (the finalself.assertEqual
fails). Why is this, and how can I make this test work reliably?I could change the return statement of
create_app_data
to call.get
but I would prefer to avoid a (seemingly) redundant call, if possible.I am using elasticsearch-dsl 8.17.1.
The text was updated successfully, but these errors were encountered: