Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

src/m/o/moztrap-HEAD/tests/factories.py   moztrap(Download)
                    app_label, codename = perm_or_name.split(".", 1)
                    perm = model.Permission.objects.get(
                        content_type__app_label=app_label, codename=codename)
                perms.append(perm)
            obj.user_permissions.add(*perms)

src/m/o/moztrap-HEAD/tests/view/manage/cases/test_forms.py   moztrap(Download)
    def test_suite(self):
        """Can pick an initial suite for case to be in (with right perms)."""
        self.user.user_permissions.add(
            model.Permission.objects.get(codename="manage_suite_cases"))
        suite = self.F.SuiteFactory.create(product=self.product)
    def test_initial_suite_order(self):
        """Adding a new case to a suite adds it in last place for the suite"""
        self.user.user_permissions.add(
            model.Permission.objects.get(codename="manage_suite_cases"))
        suite = self.F.SuiteFactory.create(product=self.product)
    def test_wrong_suite_product(self):
        """Selecting suite from wrong product results in validation error."""
        self.user.user_permissions.add(
            model.Permission.objects.get(codename="manage_suite_cases"))
        suite = self.F.SuiteFactory.create()  # some other product
    def test_new_tag(self):
        """Can create a new case with a new tag, with correct perm."""
        self.user.user_permissions.add(
            model.Permission.objects.get(codename="manage_tags"))
        data = self.get_form_data()
    def test_data_allow_new(self):
        """add_tag field has data-allow-new set true with manage_tags perm."""
        self.user.user_permissions.add(
            model.Permission.objects.get(codename="manage_tags"))