Opened 7 years ago

Closed 7 years ago

Last modified 4 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 Changed 7 years ago by Hasan Ramezani

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

comment:2 Changed 7 years ago by Hasan Ramezani

Has patch: set
Version 1, edited 7 years ago by Hasan Ramezani (previous) (next) (diff)

comment:3 Changed 7 years ago by Tim Graham

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 Changed 7 years ago by Tim Graham <timograham@…>

In 3d0dcd7:

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

comment:5 Changed 7 years ago by Tim Graham <timograham@…>

In 253adc2:

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

comment:6 Changed 7 years ago by Tim Graham <timograham@…>

In 26ad0171:

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

comment:7 Changed 7 years ago by Tim Graham

Resolution: fixed
Status: assignedclosed

comment:8 Changed 4 years ago by Mariusz Felisiak <felisiak.mariusz@…>

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