<s> """<STR_LIT>""" <EOL> import os <EOL> from django . test import TestCase <EOL> from django . core . files . uploadedfile import SimpleUploadedFile <EOL> from crash . forms import SymbolsAdminForm , CrashFrom <EOL> BASE_DIR = os . path . dirname ( __file__ ) <EOL> TEST_DATA_DIR = os . path . join ( BASE_DIR , '<STR_LIT>' ) <EOL> SYM_FILE = os . path . join ( TEST_DATA_DIR , '<STR_LIT>' ) <EOL> TAR_FILE = os . path . join ( TEST_DATA_DIR , '<STR_LIT>' ) <EOL> class SymbolsAdminFormTest ( TestCase ) : <EOL> def test_form ( self ) : <EOL> form_data = { } <EOL> with open ( SYM_FILE , '<STR_LIT:rb>' ) as f : <EOL> form_file_data = { '<STR_LIT:file>' : SimpleUploadedFile ( '<STR_LIT>' , f . read ( ) ) } <EOL> form = SymbolsAdminForm ( form_data , form_file_data ) <EOL> self . assertTrue ( form . is_valid ( ) ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT> ) <EOL> class CrashFormTest ( TestCase ) : <EOL> def test_form ( self ) : <EOL> form_file_data = dict ( upload_file_minidump = SimpleUploadedFile ( <EOL> "<STR_LIT>" , b"<STR_LIT:content>" ) ) <EOL> form_data = dict ( <EOL> appid = '<STR_LIT>' , <EOL> userid = '<STR_LIT>' , <EOL> ) <EOL> form = CrashFrom ( form_data , form_file_data ) <EOL> self . assertTrue ( form . is_valid ( ) ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT:0> ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT:7> ) <EOL> def test_form_tar_file ( self ) : <EOL> with open ( TAR_FILE , '<STR_LIT:rb>' ) as f : <EOL> form_file_data = dict ( upload_file_minidump = SimpleUploadedFile ( <EOL> "<STR_LIT>" , f . read ( ) ) ) <EOL> form_data = dict ( <EOL> appid = '<STR_LIT>' , <EOL> userid = '<STR_LIT>' , <EOL> ) <EOL> form = CrashFrom ( form_data , form_file_data ) <EOL> self . assertTrue ( form . is_valid ( ) ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] . name , '<STR_LIT>' ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT> ) <EOL> self . assertEqual ( form . cleaned_data [ '<STR_LIT>' ] , <NUM_LIT> ) </s>
