Example #1
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.anonymous_user = AnonymousUser()
     cls.other_user = PublicUserFactory()
     cls.create_content_set()
     cls.public_reply = PublicContentFactory(parent=cls.public_content)
     cls.limited_reply = LimitedContentFactory(parent=cls.limited_content)
     cls.self_reply = SelfContentFactory(parent=cls.self_content)
     cls.site_reply = SiteContentFactory(parent=cls.site_content)
     cls.public_share = PublicContentFactory(share_of=cls.public_content,
                                             author=cls.remote_profile)
     cls.limited_share = LimitedContentFactory(share_of=cls.limited_content,
                                               author=cls.remote_profile)
     cls.self_share = SelfContentFactory(share_of=cls.self_content,
                                         author=cls.remote_profile)
     cls.site_share = SiteContentFactory(share_of=cls.site_content,
                                         author=cls.remote_profile)
     cls.public_share_reply = PublicContentFactory(parent=cls.public_share)
     cls.share_limited_reply = LimitedContentFactory(
         parent=cls.limited_share)
     cls.share_self_reply = SelfContentFactory(parent=cls.self_share)
     cls.share_site_reply = SiteContentFactory(parent=cls.site_share)
     cls.limited_content_user = UserFactory()
     cls.limited_content_profile = cls.limited_content_user.profile
     cls.limited_reply.limited_visibilities.add(cls.limited_content_profile)
     cls.limited_content.limited_visibilities.add(
         cls.limited_content_profile)
 def setUpTestData(cls):
     super().setUpTestData()
     cls.public_content = PublicContentFactory(
         pinned=True, author=ProfileFactory(visibility=Visibility.SELF))
     cls.public_tag_content = PublicContentFactory(text="#foobar")
     cls.limited_content = LimitedContentFactory(author=ProfileFactory(
         visibility=Visibility.SELF))
     cls.tag = Tag.objects.get(name="foobar")
     cls.site_content = SiteContentFactory(
         pinned=True, author=ProfileFactory(visibility=Visibility.SELF))
     cls.site_tag_content = SiteContentFactory(text="#foobar")
     cls.self_user = UserFactory()
     cls.self_content = SelfContentFactory(author=cls.self_user.profile,
                                           pinned=True)
     cls.self_tag_content = SelfContentFactory(author=cls.self_user.profile,
                                               text="#foobar")
     cls.other_user = UserFactory()
     cls.anonymous_user = AnonymousUser()
     cls.other_user.profile.following.add(cls.public_content.author,
                                          cls.self_user.profile)
     cls.other_user.profile.followed_tags.add(cls.tag)
     cls.limited_content_user = UserFactory()
     cls.limited_content_profile = cls.limited_content_user.profile
     cls.limited_content.limited_visibilities.add(
         cls.limited_content_profile)
     cls.limited_tag_content = LimitedContentFactory(text="#foobar")
     cls.limited_tag_content.limited_visibilities.add(
         cls.limited_content_profile)
     cls.local_user = UserFactory()
     cls.local_content = PublicContentFactory(author=cls.local_user.profile)
Example #3
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.public_content = ContentFactory(pinned=True)
     cls.public_tag_content = ContentFactory(text="#foobar")
     cls.limited_content = LimitedContentFactory()
     cls.tag = Tag.objects.get(name="foobar")
     cls.site_content = SiteContentFactory(pinned=True)
     cls.site_tag_content = SiteContentFactory(text="#foobar")
     cls.self_user = UserFactory()
     cls.self_content = SelfContentFactory(author=cls.self_user.profile,
                                           pinned=True)
     cls.self_tag_content = SelfContentFactory(author=cls.self_user.profile,
                                               text="#foobar")
     cls.other_user = UserFactory()
     cls.anonymous_user = AnonymousUser()
     cls.other_user.profile.following.add(cls.public_content.author,
                                          cls.self_user.profile)
     cls.public_reply = PublicContentFactory(parent=cls.public_content)
     cls.limited_reply = LimitedContentFactory(parent=cls.limited_content)
     cls.self_reply = SelfContentFactory(parent=cls.self_content)
     cls.site_reply = SiteContentFactory(parent=cls.site_content)
     cls.public_share = PublicContentFactory(share_of=cls.public_content,
                                             author=cls.self_user.profile)
     cls.limited_share = LimitedContentFactory(share_of=cls.limited_content,
                                               author=cls.self_user.profile)
     cls.self_share = SelfContentFactory(share_of=cls.self_content,
                                         author=cls.self_user.profile)
     cls.site_share = SiteContentFactory(share_of=cls.site_content,
                                         author=cls.self_user.profile)
     cls.public_share_reply = PublicContentFactory(parent=cls.public_share)
     cls.share_limited_reply = LimitedContentFactory(
         parent=cls.limited_share)
     cls.share_self_reply = SelfContentFactory(parent=cls.self_share)
     cls.share_site_reply = SiteContentFactory(parent=cls.site_share)
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     PublicContentFactory(text="#foobar")
     SiteContentFactory(text="#foobar")
     SelfContentFactory(text="#foobar")
     LimitedContentFactory(text="#foobar")
     cls.content = PublicContentFactory(text="#spam")
     cls.content2 = SiteContentFactory(text="#spam")
     SelfContentFactory(text="#spam")
     LimitedContentFactory(text="#spam")
     cls.profile.followed_tags.add(Tag.objects.get(name="spam"))
Example #5
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.local_user = UserFactory()
     cls.create_content_set()
     cls.tagged_foobar = PublicContentFactory(text="#foobar", author=cls.profile)
     cls.tagged_foobar2 = SiteContentFactory(text="#foobar", author=cls.profile)
     cls.tagged_spam = PublicContentFactory(text="#spam", author=cls.profile)
     cls.tagged_spam2 = SiteContentFactory(text="#spam", author=cls.profile)
     cls.tag_foobar = Tag.objects.get(name="foobar")
     cls.tag_spam = Tag.objects.get(name="spam")
     cls.user.profile.followed_tags.add(cls.tag_spam)
Example #6
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.content = PublicContentFactory(author=cls.remote_profile)
     SiteContentFactory(author=cls.profile)
     SelfContentFactory(author=cls.profile)
     LimitedContentFactory(author=cls.profile)
Example #7
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.content = PublicContentFactory(text="#foobar")
     SiteContentFactory(text="#foobar")
     SelfContentFactory(text="#foobar")
     LimitedContentFactory(text="#foobar")
Example #8
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.content = PublicContentFactory()
     cls.content2 = PublicContentFactory()
     SiteContentFactory()
     SelfContentFactory()
     LimitedContentFactory()
Example #9
0
 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.user = PublicUserFactory()
     cls.profile = cls.user.profile
     cls.site_user = SiteUserFactory()
     cls.site_profile = cls.site_user.profile
     cls.content = PublicContentFactory(author=cls.profile)
     cls.site_content = SiteContentFactory(author=cls.profile)
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.remote_profile.followers.add(cls.profile)
     cls.create_content_set(author=cls.remote_profile)
     cls.other_public_content = PublicContentFactory()
     SiteContentFactory()
     SelfContentFactory()
     LimitedContentFactory()
Example #12
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.local_user = UserFactory()
     cls.create_content_set()
     cls.public_tagged = PublicContentFactory(text="#foobar", author=cls.profile)
     cls.site_tagged = SiteContentFactory(text="#foobar", author=cls.profile)
     cls.self_tagged = SelfContentFactory(text="#foobar", author=cls.profile)
     cls.limited_tagged = LimitedContentFactory(text="#foobar", author=cls.profile)
     cls.tag = cls.public_tagged.tags.first()
Example #13
0
 def setUpTestData(cls):
     super().setUpTestData()
     cls.create_local_and_remote_user()
     cls.anonymous_user = AnonymousUser()
     cls.other_user = PublicUserFactory()
     cls.create_content_set()
     cls.public_share = PublicContentFactory(share_of=cls.public_content, author=cls.other_user.profile)
     cls.limited_share = LimitedContentFactory(share_of=cls.limited_content, author=cls.other_user.profile)
     cls.self_share = SelfContentFactory(share_of=cls.self_content, author=cls.other_user.profile)
     cls.site_share = SiteContentFactory(share_of=cls.site_content, author=cls.other_user.profile)
     cls.other_user.profile.following.add(cls.public_content.author, cls.profile)