Opened 9 years ago

Closed 8 years ago

Last modified 5 years ago

#26022 closed Cleanup/optimization (fixed)

Use the context manager version of assertRaises decorators where appropriate

Reported by: Hasan Ramezani Owned by: Hasan Ramezani
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

rewrite below django admin register decorator test in context manager version:

  • test_wrapped_class_not_a_model_admin
  • test_custom_site_not_an_admin_site

Change History (8)

comment:1 by Hasan Ramezani, 9 years ago

Component: UncategorizedTesting framework
Owner: changed from nobody to Hasan Ramezani
Status: newassigned

comment:2 by Hasan Ramezani, 9 years ago

Has patch: set
Version 0, edited 9 years ago by Hasan Ramezani (next)

comment:3 by Tim Graham, 9 years ago

Patch needs improvement: set
Summary: rewrite django admin register decorator some testUse the context manager version of assertRaises decorators where appropriate
Triage Stage: UnreviewedAccepted
Version: 1.9master

As noted on the pull request, a more comprehensive cleanup would be appreciated.

comment:4 by Tim Graham <timograham@…>, 8 years ago

In 3d0dcd7:

Refs #26022 -- Used context manager version of assertRaises in tests.

comment:5 by Tim Graham <timograham@…>, 8 years ago

In 253adc2:

Refs #26022 -- Used context manager version of assertRaisesMessage in tests.

comment:6 by Tim Graham <timograham@…>, 8 years ago

In 26ad0171:

Refs #26022 -- Replaced six.assertRaisesRegex with assertRaisesMessage as appropriate.

comment:7 by Tim Graham, 8 years ago

Resolution: fixed
Status: assignedclosed

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 5627057f:

Refs #26022 -- Used context manager version of assertRaisesMessage in tests.

Follow up to 253adc2b8a52982139d40c4f55b3fd446e1cb8f3.

Note: See TracTickets for help on using tickets.
Back to Top