Exemplo n.º 1
0
    def setUp(self):
        set_backend(DummyCyclosBackend())

        self.group_1 = CyclosGroupFactory.create(initial=True)
        self.group_2 = CyclosGroupFactory.create()
        self.group_3 = CyclosGroupFactory.create()
        self.groupset = CyclosGroupSetFactory.create(
            groups=[self.group_1, self.group_2, self.group_3])

        self.community = CC3CommunityFactory.create(groupsets=[self.groupset])

        self.profile = CC3ProfileFactory.create(community=self.community)
        self.member_profile = CC3ProfileFactory.create(
            groupset=self.groupset, community=self.community)
        self.member_empty_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.profile.user,
                                     community=self.profile.community)

        # Create a Cyclos account for the 'member_profile'.
        self.cyclos_account = CyclosAccountFactory.create(
            cc3_profile=self.member_profile)

        self.ad = AdFactory.create(created_by=self.member_profile)

        self.url = reverse('communityadmin_ns:edit_ad',
                           kwargs={'pk': self.ad.pk})
Exemplo n.º 2
0
    def setUp(self):
        # Django CMS Page.
        self.placeholder = CMSPlaceholderFactory.create()
        self.page = CMSPageFactory.create(placeholders=(self.placeholder, ))

        self.url = reverse('communityadmin_ns:contentlist')

        self.profile = CC3ProfileFactory.create()
        self.anonymous_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.profile.user,
                                     community=self.profile.community)

        # Create a separated Community.
        self.community = CC3CommunityFactory.create()

        # Create some Community messages. `CommunityMessages` belong to a
        # Django CMS `CommunityPlugin`.
        self.plugin = CommunityPluginModelFactory.create(
            placeholder=self.placeholder)

        self.message_1 = CommunityMessageFactory.create(
            plugin=self.plugin,
            community=self.community,
            plugin__placeholder__page__publisher_is_draft=True)
        self.message_2 = CommunityMessageFactory.create(
            plugin=self.plugin,
            community=self.profile.community,
            plugin__placeholder__page__publisher_is_draft=True)
        self.message_3 = CommunityMessageFactory.create(
            plugin=self.plugin,
            community=self.profile.community,
            plugin__placeholder__page__publisher_is_draft=True)

        self.factory = RequestFactory()
Exemplo n.º 3
0
    def setUp(self):
        self.url = reverse('communityadmin_ns:transactions')

        self.profile = CC3ProfileFactory.create()
        self.anonymous_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.profile.user,
                                     community=self.profile.community)
Exemplo n.º 4
0
    def setUp(self):
        self.factory = RequestFactory()
        self.permission_class = IsCommunityAdmin()

        self.admin_profile = CC3ProfileFactory.create()
        self.member_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.admin_profile.user,
                                     community=self.admin_profile.community)
Exemplo n.º 5
0
    def setUp(self):
        group_1 = CyclosGroupFactory.create()
        group_2 = CyclosGroupFactory.create()
        group_3 = CyclosGroupFactory.create()
        self.groupset = CyclosGroupSetFactory.create(
            groups=[group_1, group_2, group_3])

        self.profile = CC3ProfileFactory.create()
        self.member_profile = CC3ProfileFactory.create(groupset=self.groupset)
        self.member_empty_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.profile.user,
                                     community=self.profile.community)
    def setUp(self):
        activate(settings.LANGUAGE_CODE)
        set_backend(DummyCyclosBackend())

        self.group_1 = CyclosGroupFactory.create(initial=True)
        self.group_2 = CyclosGroupFactory.create()
        self.group_3 = CyclosGroupFactory.create()

        self.groupset = CyclosGroupSetFactory.create(
            groups=[self.group_1, self.group_2, self.group_3])

        self.community = CC3CommunityFactory.create(groupsets=[self.groupset])

        self.from_profile = CC3ProfileFactory.create(community=self.community)
        self.to_profile = CC3ProfileFactory.create(groupset=self.groupset,
                                                   community=self.community,
                                                   business_name='MaykinMedia')

        self.invoice = InvoiceFactory.create(from_user=self.from_profile.user,
                                             to_user=self.to_profile.user)
        self.user_1 = UserFactory.create()
        self.staff_user = UserFactory.create(is_staff=True)

        self.community_admin_profile = CC3ProfileFactory.create(
            community=self.community)
        self.community_admin = CommunityAdminFactory.create(
            user=self.community_admin_profile.user, community=self.community)
        self.url = reverse('invoice_download_pdf', args=[self.invoice.id])
Exemplo n.º 7
0
    def setUp(self):
        set_backend(DummyCyclosBackend())

        self.url = reverse('communityadmin_ns:memberlist')

        self.profile = CC3ProfileFactory.create()
        self.anonymous_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.profile.user,
                                     community=self.profile.community)

        self.member_1 = CC3ProfileFactory.create(
            community=self.profile.community)
        self.member_2 = CC3ProfileFactory.create()
        self.member_3 = CC3ProfileFactory.create()

        self.factory = RequestFactory()
Exemplo n.º 8
0
    def setUp(self):
        set_backend(DummyCyclosBackend())

        self.group_1 = CyclosGroupFactory.create(initial=True)
        self.group_2 = CyclosGroupFactory.create()
        self.group_3 = CyclosGroupFactory.create()
        self.groupset = CyclosGroupSetFactory.create(
            groups=[self.group_1, self.group_2, self.group_3])

        self.community = CC3CommunityFactory.create(groupsets=[self.groupset])

        self.profile = CC3ProfileFactory.create(community=self.community)
        self.member_profile = CC3ProfileFactory.create(
            groupset=self.groupset, community=self.community)
        self.member_empty_profile = CC3ProfileFactory.create()

        CommunityAdminFactory.create(user=self.profile.user,
                                     community=self.profile.community)

        # Create a Cyclos account for the 'member_profile'.
        self.cyclos_account = CyclosAccountFactory.create(
            cc3_profile=self.member_profile)