[PATCH 00/25] Rework tests

Stephen Finucane stephen.finucane at intel.com
Fri Jun 24 07:53:21 AEST 2016


There are a couple of issues with the tests that need resolving.

* The tests make extensive use of the models, as one would expect.
  However, how these models are created varies significantly. In a lot
  of cases, "defaults" are used, yet in other cases, new instances are
  created from scratch. Standardize the creation of these tests.
* All of the tests are named using camelcase. There's nothing to be
  done about the existing unittest code, but there's no reason to use
  this for custom test code. Convert to underscore case.
* A lot of tests use hardcoded URLs, which makes it difficult to
  modify urls.py in a deployment.
* Some of the tests are grouped, or named, funnily.
* There is some code that simply does nothing, particularly around the
  areas of tearDown.

Address all of these points.

Stephen Finucane (25):
  tests: Remove 'find_in_context'
  tests: Remove use of global value
  tests: Add additional 'create_' helpers
  tests: Clean up 'test_bundles'
  tests: Clean up 'test_checks'
  tests: Clean up 'test_confirm'
  tests: Clean up 'test_detail'
  tests: Clean up 'test_encodings'
  tests: Clean up 'test_expiry'
  tests: Clean up 'test_filters'
  tests: Clean up 'test_list'
  tests: Clean up 'test_mail_settings'
  tests: Clean up 'test_mboxviews'
  tests: Clean up 'test_notifications'
  tests: Clean up 'test_person'
  tests: Rename 'test_person'
  tests: Clean up 'test_tags'
  tests: Clean up 'test_updates'
  tests: Clean up 'test_user'
  tests: Clean up 'test_user_browser'
  tests: Clean up 'test_xmlrpc'
  tests: Clean up 'test_patchparser'
  tests: Rework and rename 'test_patchparser'
  tests: Remove 'defaults' class
  tests: Remove 'default_states' fixture requirement

 patchwork/tests/test_bundles.py       |  267 +++++++-------
 patchwork/tests/test_checks.py        |   18 +-
 patchwork/tests/test_completion.py    |   59 +++
 patchwork/tests/test_confirm.py       |   30 +-
 patchwork/tests/test_detail.py        |    6 +-
 patchwork/tests/test_encodings.py     |   71 +---
 patchwork/tests/test_expiry.py        |   58 ++--
 patchwork/tests/test_filters.py       |   36 +-
 patchwork/tests/test_list.py          |   53 ++--
 patchwork/tests/test_mail_settings.py |  161 ++++-----
 patchwork/tests/test_mboxviews.py     |  303 ++++++----------
 patchwork/tests/test_notifications.py |  221 +++++------
 patchwork/tests/test_parser.py        |  672 +++++++++++++++++++++++++++++++++
 patchwork/tests/test_patchparser.py   |  670 --------------------------------
 patchwork/tests/test_person.py        |   59 ---
 patchwork/tests/test_tags.py          |  117 +++---
 patchwork/tests/test_updates.py       |  104 ++++--
 patchwork/tests/test_user.py          |  262 ++++++--------
 patchwork/tests/test_user_browser.py  |   10 +-
 patchwork/tests/test_xmlrpc.py        |   27 +-
 patchwork/tests/utils.py              |  316 ++++++++++------
 21 files changed, 1698 insertions(+), 1822 deletions(-)
 create mode 100644 patchwork/tests/test_completion.py
 create mode 100644 patchwork/tests/test_parser.py
 delete mode 100644 patchwork/tests/test_patchparser.py
 delete mode 100644 patchwork/tests/test_person.py

-- 
1.7.4.1



More information about the Patchwork mailing list