Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand our suite of helper test cases/mixins #10

Open
adam-thomas opened this issue May 2, 2014 · 3 comments
Open

Expand our suite of helper test cases/mixins #10

adam-thomas opened this issue May 2, 2014 · 3 comments

Comments

@adam-thomas
Copy link
Contributor

I've been finding myself copy-and-pasting quite a lot when making tests, and I think we could use more helpers along the lines of URLsMixinBase and its descendants.

We could use:

  • Mixins for testing forms, including crispy_forms.
  • Mixins for testing API views, especially ones built from viewsets, which have a standard setup and are the most egregiously copy-and-paste-heavy. Being able to use mixins in order to test a series of views for a particular model in just a few concise lines would be lovely.
  • Mixins for testing serializers. These are also quite copy-and-paste-heavy, and long-winded with it.
  • Mixins for basic model tests, ideally asserting str() and fields.

Having basic TestCases for all of these mixins (like URLsTestCaseREST) would also be stellar. I think we could save a lot of time and tedium by refactoring our tests now.

@incuna/backend thoughts/suggestions for more test mixins?

@meshy
Copy link
Collaborator

meshy commented May 2, 2014

Sorry deleted last comment... public project and all.

@LilyFoote
Copy link
Collaborator

Something I think would be nice would be adding get, post, put, patch and delete methods to BaseAPIRequestTestCase and BaseRequestTestCase.

@adam-thomas
Copy link
Contributor Author

@Ian-Foote 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants