Opened 14 years ago

Closed 14 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 14 years ago.
Don't require access to the internet while running tests.

Download all attachments as: .zip

Change History (5)

by Gregor Müllegger, 14 years ago

Attachment: ticket16189.1.diff added

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

comment:1 by Ernesto Rico-Schmidt, 14 years ago

Triage Stage: UnreviewedAccepted

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

comment:3 by Jannis Leidel, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Ramiro Morales, 14 years ago

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