Opened 5 years ago

Closed 5 years ago

#16816 closed Bug (fixed)

URLField validation mock added in r16451 neutered by changes from r16760

Reported by: Ramiro Morales Owned by: nobody
Component: Testing framework Version: master
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The mocking is done so the test suite doesn't depend on Internet connectivity. We need to update the strategy we use to accompany the new implementation of the validation code.

Attachments (4)

16816.verify-exists-test-mock.diff (2.0 KB) - added by Julien Phalip 5 years ago.
16816.verify-exists-test-mock.2.diff (3.4 KB) - added by Julien Phalip 5 years ago.
16816.verify-exists-test-mock.3.diff (3.6 KB) - added by Julien Phalip 5 years ago.
16816.verify-exists-test-mock.4.diff (4.4 KB) - added by Julien Phalip 5 years ago.
Small tweak to the previous patch. Not sure where to move verify_exists_urls() to avoid doing that ugly relative import in validation/tests.py

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 years ago by Alex Gaynor

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

comment:2 Changed 5 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

Changed 5 years ago by Julien Phalip

Changed 5 years ago by Julien Phalip

comment:3 Changed 5 years ago by anonymous

Triage Stage: AcceptedReady for checkin

comment:4 Changed 5 years ago by anonymous

Triage Stage: Ready for checkinAccepted

Moving back to accepted because it works on Python 2.5 but fails with 2.6 and 2.7

Changed 5 years ago by Julien Phalip

comment:5 Changed 5 years ago by Julien Phalip

The failures in Python > 2.5 were due to the fact that urllib2.OpenerDirector.open() has an extra timeout parameter. I've added it to the mock open() method and that seems to fix it.

Changed 5 years ago by Julien Phalip

Small tweak to the previous patch. Not sure where to move verify_exists_urls() to avoid doing that ugly relative import in validation/tests.py

comment:6 Changed 5 years ago by Julien Phalip

Resolution: fixed
Status: newclosed

In [17059]:

Fixed #16816 -- Tweaked the test mock for URLField.verify_exists to allow tests to pass when there is no Internet connection available. Many thanks to Ramiro Morales, Aymeric Augustin and Florian Apolloner for the patch reviews.

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