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: Gregor Müllegger Owned by: Gregor Müllegger
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

Description

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 Gregor Müllegger 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 Gregor Müllegger

Attachment: ticket16189.1.diff added

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

comment:1 Changed 5 years ago by Ernesto Rico-Schmidt

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

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

comment:3 Changed 5 years ago by Jannis Leidel

Triage Stage: AcceptedReady for checkin

comment:4 Changed 5 years ago by Ramiro Morales

Resolution: fixed
Status: newclosed

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