| 975 | >>> f.clean('.') |
| 976 | Traceback (most recent call last): |
| 977 | ... |
| 978 | ValidationError: [u'Enter a valid URL.'] |
| 979 | >>> f.clean('com.') |
| 980 | Traceback (most recent call last): |
| 981 | ... |
| 982 | ValidationError: [u'Enter a valid URL.'] |
| 983 | >>> f.clean('http://example.com.') |
| 984 | u'http://example.com./' |
| 985 | >>> f.clean('example.com.') |
| 986 | u'http://example.com./' |
| 987 | |
| 988 | # hangs "forever" if catastrophic backtracking in ticket:#11198 not fixed |
| 989 | >>> f.clean('http://%s' % ("X"*200,)) |
| 990 | Traceback (most recent call last): |
| 991 | ... |
| 992 | ValidationError: [u'Enter a valid URL.'] |
| 993 | |
| 994 | # a second test, to make sure the problem is really addressed, even on |
| 995 | # domains that don't fail the domain label length check in the regex |
| 996 | >>> f.clean('http://%s' % ("X"*60,)) |
| 997 | Traceback (most recent call last): |
| 998 | ... |
| 999 | ValidationError: [u'Enter a valid URL.'] |
| 1000 | |