def setUp(self): self.client = Client() region = Region(name='Region 1', slug='region-1') region.save() Site.objects.bulk_create([ Site(name='Site 1', slug='site-1', region=region), Site(name='Site 2', slug='site-2', region=region), Site(name='Site 3', slug='site-3', region=region), ])
def setUp(self): self.client = Client() region = Region(name='Region 1', slug='region-1') region.save() Site.objects.bulk_create([ Site(name='Site 1', slug='site-1', region=region), Site(name='Site 2', slug='site-2', region=region), Site(name='Site 3', slug='site-3', region=region), ])
def setUp(self): user = create_test_user(permissions=['dcim.view_site']) self.client = Client() self.client.force_login(user) region = Region(name='Region 1', slug='region-1') region.save() Site.objects.bulk_create([ Site(name='Site 1', slug='site-1', region=region), Site(name='Site 2', slug='site-2', region=region), Site(name='Site 3', slug='site-3', region=region), ])