def setUp(self): set_backend(DummyCyclosBackend()) self.profile = CC3ProfileFactory.create() self.price_option = AdPricingOptionFactory.create(title='TBD') self.ad_1 = AdFactory.create(price='10.0', created_by=self.profile, status=AD_STATUS_ACTIVE) self.ad_2 = AdFactory.create(created_by=self.profile, price_option=self.price_option)
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})
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 = AuthUserProfileFactory.create( groupset=self.groupset, community=self.community, business_name='MaykinMedia', web_payments_enabled=True) self.member_empty_profile = CC3ProfileFactory.create() # Create a Cyclos account for the 'member_profile'. self.cyclos_account = CyclosAccountFactory.create( cc3_profile=self.profile) self.ad = AdFactory.create(created_by=self.profile) self.url = reverse('accounts_edit_ad', kwargs={'pk': self.ad.pk})
def setUp(self): set_backend(DummyCyclosBackend()) self.profile_1 = CC3ProfileFactory.create() self.profile_2 = CC3ProfileFactory.create() self.price_option = AdPricingOptionFactory.create(title='TBD') self.ad_active = AdFactory.create(price='10.0', status=AD_STATUS_ACTIVE, created_by=self.profile_1) self.ad_disabled = AdFactory.create(price='10.0', status=AD_STATUS_DISABLED, created_by=self.profile_1) self.ad_onhold = AdFactory.create(price='10.0', status=AD_STATUS_ONHOLD, created_by=self.profile_1)
def setUp(self): self.factory = RequestFactory() self.permission_class = IsAdManager() self.owner_profile = CC3ProfileFactory.create() self.member_profile = CC3ProfileFactory.create() self.ad = AdFactory.create(created_by=self.owner_profile)
def test_create_ad_makes_profile_visible(self): """ Test that creating an ad results in the user's profile becoming visible. """ self.assertFalse(self.profile.is_visible) ad = AdFactory.create(created_by=self.profile) prof = CC3Profile.objects.get(id=self.profile.id) self.assertTrue(prof.is_visible)
def setUp(self): set_backend(DummyCyclosBackend()) self.ad = AdFactory.create() self.user = UserFactory.create(first_name='Vanessa', last_name='Gaultier', username='******', email='*****@*****.**') self.profile = CC3ProfileFactory.create(user=self.user) self.form = MarketplacePayForm(user=self.profile.user) self.test_data = { 'amount': 10.0, 'contact_name': 'Vanessa Gaultier', 'description': 'Testing payment', 'ad': self.ad.pk }