def setUpTestData(cls): super().setUpTestData() cls.user = UserFactory() cls.profile = cls.user.profile cls.follower = PublicProfileFactory() cls.follower2 = PublicProfileFactory() cls.profile.following.add(cls.follower) cls.profile.following.add(cls.follower2) cls.content = ContentFactory(author=cls.profile) cls.content2 = ContentFactory(author=cls.follower) cls.reply = ContentFactory(author=cls.profile, parent=cls.content2, content_type=ContentType.REPLY) cls.share = ContentFactory(author=cls.profile, share_of=cls.content2, content_type=ContentType.SHARE)
def _generate(cls, strategy, params): recipients = params.pop("recipients", None) content = super()._generate(strategy, params) if recipients is not None: content.limited_visibilities.clear() content.limited_visibilities.set(recipients) else: recipient1 = PublicProfileFactory() recipient2 = PublicProfileFactory() content.limited_visibilities.clear() content.limited_visibilities.set([recipient1, recipient2]) return content
def setUpTestData(cls): super().setUpTestData() cls.create_local_and_remote_user() cls.local_content = LocalContentFactory() cls.local_content2 = LocalContentFactory(guid=str(uuid4())) cls.remote_content = PublicContentFactory() cls.remote_profile2 = PublicProfileFactory()
def create_content_set(target, author=None): if not author: author = PublicProfileFactory() target.public_content = PublicContentFactory(author=author) target.site_content = SiteContentFactory(author=author) target.self_content = SelfContentFactory(author=author) target.limited_content = LimitedContentFactory(author=author)
def setUpTestData(cls): super().setUpTestData() cls.public_user = PublicUserFactory() cls.public_profile = cls.public_user.profile cls.remote_profile = PublicProfileFactory() cls.user = UserFactory() cls.profile = cls.user.profile
def setUpTestData(cls): super().setUpTestData() cls.create_local_and_remote_user() cls.user_recipient = PublicProfileFactory() cls.user_recipient2 = PublicProfileFactory() cls.content = PublicContentFactory(author=cls.remote_profile) cls.content2 = PublicContentFactory(author=cls.remote_profile) cls.limited_content = LimitedContentFactory(author=cls.remote_profile) cls.limited_content2 = LimitedContentFactory(author=cls.profile) cls.limited_content_with_recipients = LimitedContentWithRecipientsFactory(recipients=[ cls.user_recipient, cls.user_recipient2 ]) cls.user_content = PublicContentFactory(author=cls.profile) cls.share = PublicContentFactory(share_of=cls.content) cls.reply = PublicContentFactory(parent=cls.content) cls.reply_parent_with_recipients = PublicContentFactory(parent=cls.limited_content_with_recipients)
def setUpTestData(cls): super().setUpTestData() cls.public_user = PublicUserFactory() cls.public_profile = cls.public_user.profile cls.remote_profile = PublicProfileFactory() cls.user = UserFactory() cls.profile = cls.user.profile cls.limited_user = LimitedUserFactory() cls.limited_profile = cls.limited_user.profile cls.public_profile.followers.add(cls.remote_profile) cls.limited_profile.followers.add(cls.remote_profile)
def setUpTestData(cls): super().setUpTestData() cls.admin_user = AdminUserFactory() cls.user = PublicUserFactory() cls.profile = PublicProfileFactory()
def setUpTestData(cls): super().setUpTestData() cls.user = PublicUserFactory() cls.user_content = PublicContentFactory(author=cls.user.profile) cls.profile = PublicProfileFactory() cls.profile_content = PublicContentFactory(author=cls.profile)
def setUpTestData(cls): super().setUpTestData() cls.public_profile = PublicProfileFactory(name="Foobar") cls.content = ContentFactory(text='#barfoo') cls.tag = cls.content.tags.first()
def create_local_and_remote_user(target): target.user = PublicUserFactory() target.profile = target.user.profile target.remote_profile = PublicProfileFactory()
def setUpTestData(cls): super().setUpTestData() cls.public_profile = PublicProfileFactory(name="Foobar")