<s> """<STR_LIT>""" <EOL> import os <EOL> from django . test import TestCase <EOL> from django . core . files . uploadedfile import SimpleUploadedFile <EOL> from feedback . forms import FeedbackForm <EOL> import logging <EOL> IMG_FILE = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class FeedbackFormTest ( TestCase ) : <EOL> def test_form ( self ) : <EOL> form_file_data = dict ( <EOL> screenshot = SimpleUploadedFile ( '<STR_LIT>' , content = open ( IMG_FILE , '<STR_LIT:rb>' ) . read ( ) ) , <EOL> blackbox = SimpleUploadedFile ( '<STR_LIT>' , b'<STR_LIT:U+0020>' ) , <EOL> system_logs = SimpleUploadedFile ( '<STR_LIT>' , b'<STR_LIT:U+0020>' * <NUM_LIT:2> ) , <EOL> attached_file = SimpleUploadedFile ( '<STR_LIT>' , b'<STR_LIT:U+0020>' * <NUM_LIT:3> ) , <EOL> ) <EOL> form_data = dict ( <EOL> description = '<STR_LIT>' , <EOL> ) <EOL> form = FeedbackForm ( form_data , form_file_data ) <EOL> self . assertTrue ( form . is_valid ( ) ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT> ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT:1> ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT:2> ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT:3> ) <EOL> def test_form_no_description ( self ) : <EOL> form_file_data = dict ( <EOL> screenshot = SimpleUploadedFile ( '<STR_LIT>' , content = open ( IMG_FILE , '<STR_LIT:rb>' ) . read ( ) ) , <EOL> blackbox = SimpleUploadedFile ( '<STR_LIT>' , b'<STR_LIT:U+0020>' ) , <EOL> system_logs = SimpleUploadedFile ( '<STR_LIT>' , b'<STR_LIT:U+0020>' ) , <EOL> attached_file = SimpleUploadedFile ( '<STR_LIT>' , b'<STR_LIT:U+0020>' ) , <EOL> ) <EOL> form_data = dict ( <EOL> email = '<STR_LIT>' , <EOL> page_url = '<STR_LIT>' , <EOL> ) <EOL> form = FeedbackForm ( form_data , form_file_data ) <EOL> self . assertFalse ( form . is_valid ( ) ) </s>
