<s> import os <EOL> from django . conf import settings <EOL> from transifex . languages . models import Language <EOL> from transifex . txcommon . tests . base import BaseTestCase <EOL> from transifex . resources . formats . pofile import POHandler <EOL> from transifex . resources . models import Resource <EOL> from transifex . resources . tests . api . utils import ORIGINAL , TRANSLATION <EOL> class APIBaseTests ( BaseTestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . current_path = os . path . split ( __file__ ) [ <NUM_LIT:0> ] <EOL> super ( APIBaseTests , self ) . setUp ( ) <EOL> self . data = ORIGINAL <EOL> self . trans = TRANSLATION <EOL> self . pofile_path = os . path . join ( <EOL> settings . TX_ROOT , '<STR_LIT>' <EOL> ) <EOL> handler = POHandler ( '<STR_LIT>' % self . pofile_path ) <EOL> handler . set_language ( self . language_en ) <EOL> handler . parse_file ( is_source = True ) <EOL> handler . bind_resource ( self . resource ) <EOL> handler . save2db ( is_source = True ) <EOL> handler . bind_file ( '<STR_LIT>' % self . pofile_path ) <EOL> handler . set_language ( self . language ) <EOL> handler . parse_file ( ) <EOL> handler . save2db ( ) </s>
