Ticket #4652: test.py

File test.py, 404 bytes (added by Eren Türkay <turkay.eren@…>, 8 years ago)

test-case

Line 
1#!/usr/bin/python
2# -*- coding: utf-8 -*-
3
4from django import newforms as forms
5
6class RegisterForm(forms.Form):
7    homepage = forms.URLField(required=False, verify_exists=False, initial='http://')
8
9    def clean_homepage(self):
10       field_data = self.clean_data['homepage']
11          if not field_data or field_data == 'http://':
12             return ''
13          else:
14             return field_data
Back to Top