How to use reverse_cleanup_m2m_pivot method in autotest

Best Python code snippet using autotest_python

037_db_constraints.py

Source: 037_db_constraints.py Github

copy

Full Screen

...72 create_foreign_key_constraint(manager, pivot_table, first_field,73 first_table)74 create_foreign_key_constraint(manager, pivot_table, second_field,75 second_table)76def reverse_cleanup_m2m_pivot(manager, pivot_table, first_field, second_field,77 drop_unique):78 drop_foreign_key_constraint(manager, pivot_table, second_field)79 drop_foreign_key_constraint(manager, pivot_table, first_field)80 if drop_unique:81 drop_unique_index(manager, pivot_table, second_field)82TABLES = (83 ('hosts_labels', 'host_id', 'hosts', 'label_id', 'labels', True),84 ('acl_groups_hosts', 'host_id', 'hosts', 'aclgroup_id', 'acl_groups',85 True),86 ('acl_groups_users', 'user_id', 'users', 'aclgroup_id', 'acl_groups',87 True),88 ('autotests_dependency_labels', 'test_id', 'autotests', 'label_id',89 'labels', False),90 ('jobs_dependency_labels', 'job_id', 'jobs', 'label_id', 'labels',91 False),92 ('ineligible_host_queues', 'job_id', 'jobs', 'host_id', 'hosts', True),93 )94def migrate_up(manager):95 for (table, first_field, first_table, second_field, second_table,96 create_unique) in TABLES:97 cleanup_m2m_pivot(manager, table, first_field, first_table,98 second_field, second_table, create_unique)99def migrate_down(manager):100 for (table, first_field, first_table, second_field, second_table,101 drop_unique) in reversed(TABLES):102 reverse_cleanup_m2m_pivot(manager, table, first_field, second_field,...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Three Techniques for Improved Communication and Testing

Anyone who has worked in the software industry for a while can tell you stories about projects that were on the verge of failure. Many initiatives fail even before they reach clients, which is especially disheartening when the failure is fully avoidable.

Continuous Integration explained with jenkins deployment

Continuous integration is a coding philosophy and set of practices that encourage development teams to make small code changes and check them into a version control repository regularly. Most modern applications necessitate the development of code across multiple platforms and tools, so teams require a consistent mechanism for integrating and validating changes. Continuous integration creates an automated way for developers to build, package, and test their applications. A consistent integration process encourages developers to commit code changes more frequently, resulting in improved collaboration and code quality.

How Testers Can Remain Valuable in Agile Teams

Traditional software testers must step up if they want to remain relevant in the Agile environment. Agile will most probably continue to be the leading form of the software development process in the coming years.

LIVE With Automation Testing For OTT Streaming Devices ????

People love to watch, read and interact with quality content — especially video content. Whether it is sports, news, TV shows, or videos captured on smartphones, people crave digital content. The emergence of OTT platforms has already shaped the way people consume content. Viewers can now enjoy their favorite shows whenever they want rather than at pre-set times. Thus, the OTT platform’s concept of viewing anything, anytime, anywhere has hit the right chord.

Starting & growing a QA Testing career

The QA testing career includes following an often long, winding road filled with fun, chaos, challenges, and complexity. Financially, the spectrum is broad and influenced by location, company type, company size, and the QA tester’s experience level. QA testing is a profitable, enjoyable, and thriving career choice.

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