Last active
October 30, 2016 02:09
-
-
Save rightx2/19da0ba122366f7b9cffab16f8e1255f to your computer and use it in GitHub Desktop.
strange thing happens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## models.py | |
class OrderImage(TimeStampedModel): | |
img = models.ImageField() | |
name = models.CharField(max_length=40) | |
## forms.py | |
class OrderImageForm(forms.ModelForm): | |
class Meta: | |
model = OrderImage | |
fields = ['img', 'name',] | |
def clean_name(self): | |
print("name") | |
def clean_img(self): | |
print("img") | |
## tests.py | |
def test_a(self): | |
form = OrderImageForm({ | |
'img':'b', | |
'name':'a' | |
}) | |
form.is_valid() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment