How to use create_admin_group method in autotest

Best Python code snippet using autotest_python

management.py

Source:management.py Github

copy

Full Screen

1from django.contrib import auth2from south.signals import post_migrate3BASIC_ADMIN = 'Basic admin'4def create_admin_group(app, **kwargs):5 """6 Create a basic admin group with permissions for managing basic autotest7 objects.8 """9 print "Creatin/updating Basic admin group"10 admin_group, created = auth.models.Group.objects.get_or_create(11 name=BASIC_ADMIN)12 admin_group.save() # must save before adding permissions13 PermissionModel = auth.models.Permission14 have_permissions = list(admin_group.permissions.all())15 for model_name in ('host', 'label', 'test', 'aclgroup', 'profiler',16 'atomicgroup'):17 for permission_type in ('add', 'change', 'delete'):18 codename = permission_type + '_' + model_name...

Full Screen

Full Screen

0014_create_admin_group.py

Source:0014_create_admin_group.py Github

copy

Full Screen

1# -*- coding: utf-8 -*-2from __future__ import unicode_literals3from django.db import migrations4from course_discovery.apps.publisher.constants import ADMIN_GROUP_NAME5def create_admin_group(apps, schema_editor):6 Group = apps.get_model('auth', 'Group')7 Group.objects.get_or_create(name=ADMIN_GROUP_NAME)8def remove_admin_group(apps, schema_editor):9 Group = apps.get_model('auth', 'Group')10 Group.objects.filter(name=ADMIN_GROUP_NAME).delete()11class Migration(migrations.Migration):12 dependencies = [13 ('publisher', '0013_create_enable_email_notifications_switch'),14 ('auth', '0006_require_contenttypes_0002'),15 ]16 operations = [17 migrations.RunPython(create_admin_group, remove_admin_group)...

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