gardenbuilder-app / gardenbuilder-backend-python

Django-based REST API
6 stars 11 forks source link

Write additional test for gardens query #40

Open capndave opened 3 years ago

capndave commented 3 years ago

Type

Feature request

Problem or To-Do

In gardens/tests.py, both test_gardens_query and test_incorrect_gardens_query_throws_error pass because calling the query throws an error, because the default user associated with the query is anonymous (and is not is_staff or is_superuser. Please mock a client or response that has a superuser or staff user as the requester, and pass it in as context so that the query will not throw an error.

Additional Information

Please see here and here

ZayX0 commented 3 years ago

I can give this a shot, just to clarify this issue is looking to update both those tests with a superuser context so that they don't throw an error?

capndave commented 3 years ago

Please just make one additional test, very similar to the first, then add superuser context to it so it doesn't throw an error. Thanks!