Replies: 1 comment
-
|
I think I got it figured out. I need to pass a dict with some binary file data to the def test_saves_clean_csv_file(logged_client, test_file_path):
with open(f"{test_file_path}/clean.csv", "rb") as clean_csv:
data = {
"filename": "clean_csv.csv",
"name": "clean_csv",
"file": clean_csv,
}
res = logged_client.post("/userdata/upload", data=data)
assert res.status == 200The test doesn't pass, but that's because I need to clean up some of the code that works with it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, it's me again! Sorry to ask so many questions, but I'm having a little trouble finding an answer in the docs.
For unit tests, I'm having some difficulty understanding how I would initiate or mock a file upload. There's a lot of functionality around file uploads that I need to make sure works properly and, well, I just don't know how to proceed with that in Pytest/Emmett.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions