Geotrek-admin icon indicating copy to clipboard operation
Geotrek-admin copied to clipboard

Optimize test duration

Open submarcos opened this issue 3 years ago • 1 comments

refactor test usage to improve test duration.

  • By using TestCase subclasses only if required
  • By using ApiTestCase on DRF views
  • By using force_login if login should not be tested
  • By using setupTestData for data creation and setup for user force_login

submarcos avatar Jan 25 '22 09:01 submarcos

For example, by using these best practices on infrastructure.tests.test_admin, test duration decrease from 12s to 2s.

submarcos avatar Jan 25 '22 09:01 submarcos