def setUp(self) -> None: reset_permissions() self.superuser = default_users.root self.superuser_client = APIClient() self.superuser_client.force_authenticate(self.superuser) self.pr = Product.objects.create() self.br = Brand.objects.create()
def setUp(self) -> None: reset_permissions() self.user = User.objects.create(username="******") self.user_client = APIClient() self.user_client.force_authenticate(self.user) self.brand = Brand.objects.create(name="brand") self.product = Product.objects.create(barcode="product")
def clear(request): shell("python3 manage.py flush --no-input") cache.clear() reset_permissions([Product, Brand]) add_perms_shortcut(default_groups.anyone, Product, "rwcd") add_perms_shortcut(default_groups.anyone, Brand, "rwcd") return HttpResponse("Successfully deleted all.")
def setUp(self) -> None: p.reset_permissions() self.user = User.objects.create(username="******") self.user_client = APIClient() self.user_client.force_authenticate(self.user) self.brand = Brand.objects.create(name="brand") self.product = Product.objects.create(barcode="prodcut", brand=self.brand) self.assertEqual(1, self.brand.products.count())
def setUp(self) -> None: reset_permissions() self.superuser = default_users.root self.superuser_client = APIClient() self.superuser_client.force_authenticate(self.superuser) self.brand = Brand.objects.create(name="brand") self.products = [ Product.objects.create(barcode=f"product_{i+1}", brand=self.brand) for i in range(5) ]
def setUp(self) -> None: reset_permissions() self.user = User.objects.create(username="******") self.user_client = APIClient() self.user_client.force_authenticate(self.user) self.brand = Brand.objects.create(name="brand") self.products = [ Product.objects.create( barcode=f"product_{i+1}", brand=self.brand, priority=i, ) for i in range(100) ]
def setUp(self) -> None: p.reset_permissions() self.user = User.objects.create(username="******") self.user_client = APIClient() self.user_client.force_authenticate(self.user) self.pr1 = Product.objects.create()
def setUp(self) -> None: p.reset_permissions() self.user_client = APIClient()
def setUp(self) -> None: reset_permissions() self.user = get_user_model().objects.create()