Changes between Initial Version and Version 1 of Ticket #32959


Ignore:
Timestamp:
Jul 22, 2021, 12:29:29 AM (3 years ago)
Author:
Chris Jerdonek
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32959 – Description

    initial v1  
    1 I noticed that the URLValidator tests have a number of test cases defined in separate text files (`valid_urls.txt` and `invalid_urls.txt`): https://github.com/django/django/blob/012f38f9594b35743e9ab231757b7b62db638323/tests/validators/tests.py
     1I noticed that the URLValidator tests have a number of test cases defined in separate text files (`valid_urls.txt` and `invalid_urls.txt`): https://github.com/django/django/tree/012f38f9594b35743e9ab231757b7b62db638323/tests/validators
    22
    33However, it seems like it would be more maintainable if these test cases were defined in a Python module (e.g. the same `tests.py` file containing the test code). One reason is that there aren't actually that many test cases to warrant a separate file. Another is that having them as part of a Python module would permit them to be annotated with code comments. Currently, none of the test cases have any comments elaborating on what they're testing, and having them in a text file precludes that possibility. Finally, if there are any concerns about mistranscribing from the text files to a Python module, the transcription could be done with a Python script to eliminate the possibility of transcription errors.
Back to Top