<s> import unittest <EOL> from flask . ext . testing import TestCase <EOL> from lingobarter import create_app <EOL> from lingobarter . core . admin import create_admin <EOL> class BasicTestCase ( TestCase ) : <EOL> def setUp ( self ) : <EOL> self . db = list ( self . app . extensions . get ( '<STR_LIT>' ) . keys ( ) ) [ <NUM_LIT:0> ] <EOL> self . db . connection . drop_database ( '<STR_LIT>' ) <EOL> from lingobarter . utils . populate import Populate <EOL> Populate ( self . db ) ( ) <EOL> def login ( self , username , password ) : <EOL> return self . app . post ( '<STR_LIT>' , data = dict ( <EOL> username = username , <EOL> password = password <EOL> ) , follow_redirects = True ) <EOL> def logout ( self ) : <EOL> return self . app . get ( '<STR_LIT>' , follow_redirects = True ) <EOL> def get_config ( self , key ) : <EOL> return self . app . config . store . get ( key ) <EOL> def create_app ( self ) : <EOL> self . admin = create_admin ( ) <EOL> return create_app ( config = '<STR_LIT>' , <EOL> DEBUG = False , <EOL> test = True , <EOL> admin_instance = self . admin ) <EOL> def test_has_mongoengine ( self ) : <EOL> self . assertTrue ( self . app . extensions . get ( '<STR_LIT>' ) ) <EOL> def test_db_is_connected_in_the_test_database ( self ) : <EOL> self . assertTrue ( <EOL> self . db . connection . PORT == self . get_config ( '<STR_LIT>' ) <EOL> ) <EOL> self . assertTrue ( <EOL> self . db . connection . HOST == self . get_config ( '<STR_LIT>' ) <EOL> ) <EOL> def test_app_has_admin ( self ) : <EOL> self . assertTrue ( self . app . extensions . get ( "<STR_LIT>" ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) <EOL> """<STR_LIT>""" </s>
