vintasoftware / django-ai-assistant

Integrate AI Assistants with Django to build intelligent applications
https://vintasoftware.github.io/django-ai-assistant/
MIT License
204 stars 12 forks source link

Draft: Threads views tests #92

Closed amandasavluchinske closed 2 months ago

amandasavluchinske commented 2 months ago

Folks, I created this draft to get your opinion on something. For test data, we have a few options:

  1. Use a lib like factory or baker - I'm not a huge fan of this option as this lib's models are fairly simple, so I don't think we gain a lot by adding this extra dependency.
  2. Create objects within the test file - I think this one is simple, but can become a little messy.
  3. Create a helper service within the test file - Could work, but I also find it a little messy.
  4. Create a helper service in helpers.py (within the tests folder) - That's what I went with, but I also saw there's an utils.py file. I figured the purposes were a little different, but I can add the helper to utils if it makes sense.

Anyway, let me know what you think. This is not a blocker, I'm working on other tests in the meantime, but I'd like to get your opinion before opening the definitive PR.

fjsj commented 2 months ago

Use a lib like factory or baker - I'm not a huge fan of this option as this lib's models are fairly simple, so I don't think we gain a lot by adding this extra dependency.

It's not a problem because that will be a test-only dependency. I think it's fine to use model bakery.