Opened 5 years ago

Closed 5 years ago

#16189 closed Cleanup/optimization (fixed)

Tests with URLField(verify_exists=True) should use a mock and not access the internet directly.

Reported by: gregmuellegger Owned by: gregmuellegger
Component: Testing framework Version: 1.3
Severity: Normal Keywords: verify_exists
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Currently the testsuite tries to hit some domains to test the verify_exists=True behaviour of URLFields. However unittests should not require any external resources.

urllib2.urlopen should be mocked in the tests to provide faster and more reliable tests.

Attachments (1)

ticket16189.1.diff (4.8 KB) - added by gregmuellegger 5 years ago.
Don't require access to the internet while running tests.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by gregmuellegger

Don't require access to the internet while running tests.

comment:1 Changed 5 years ago by nnrcschmdt

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Patch looks good, it applies without problem. The tests pass.

comment:3 Changed 5 years ago by jezdez

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 5 years ago by ramiro

  • Resolution set to fixed
  • Status changed from new to closed

In [16451]:

Fixed #16189 -- Modified test that need Internet access so they use a mock instead. Thanks Gregor Müellegger for the patch.

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