How to use get_create_test_view_sql method in autotest

Best Python code snippet using autotest_python

rpc_interface_unittest.py

Source:rpc_interface_unittest.py Github

copy

Full Screen

...28 attribute varchar(90) NOT NULL,29 value numeric(31, 12) NULL30);31"""32def get_create_test_view_sql():33 """34 Returns the SQL code that creates the test view35 """36 dir_path = os.path.dirname(os.path.abspath(__file__))37 sql_path = os.path.join(dir_path, 'sql', 'tko-test-view-2.sql')38 return open(sql_path).read()39def setup_test_view():40 """41 Django has no way to actually represent a view; we simply create a model for42 TestView. So manually create the view.43 """44 cursor = connection.cursor()45 cursor.execute('DROP VIEW IF EXISTS tko_test_view_2')46 cursor.execute(get_create_test_view_sql())47def fix_iteration_tables():48 """49 Since iteration tables don't have any real primary key, we "fake" one in the50 Django models. So fix up the generated schema to match the real schema.51 """52 cursor = connection.cursor()53 cursor.execute('DROP TABLE tko_iteration_attributes')54 cursor.execute(_CREATE_ITERATION_ATTRIBUTES)55 cursor.execute('DROP TABLE tko_iteration_result')56 cursor.execute(_CREATE_ITERATION_RESULTS)57class TkoTestMixin(object):58 def _patch_sqlite_stuff(self):59 self.god.stub_with(models.TempManager, '_get_column_names',60 self._get_column_names_for_sqlite3)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful