Exemple #1
0
    def setUp(self) -> None:
        super().setUp()

        obj = testfunc.create_mentionable_object(
            "Content that might mention a URL")
        self.absolute_url = obj.get_absolute_url()
        self.all_text = obj.all_text()
    def test_get_endpoint(self):
        """`/get` endpoint is accessible."""
        obj = testfunc.create_mentionable_object()

        response = self.client.get(testfunc.endpoint_get_webmentions(),
                                   data={"url": obj.get_absolute_url()})
        self.assertEqual(200, response.status_code)
Exemple #3
0
    def setUp(self) -> None:
        super().setUp()

        obj = testfunc.create_mentionable_object()
        self.source = testfunc.random_url()
        self.target = testfunc.get_absolute_url_for_object(obj)
        self.http_post = QueryDict(
            f"source={self.source}&target={self.target}")
        self.sent_by = "localhost"
Exemple #4
0
    def setUp(self) -> None:
        super().setUp()

        source = testfunc.random_url()
        obj = testfunc.create_mentionable_object(content=testfunc.random_str())

        PendingIncomingWebmention.objects.create(
            source_url=source,
            target_url=testfunc.get_absolute_url_for_object(obj),
            sent_by="localhost",
        )
        PendingOutgoingContent.objects.create(
            absolute_url=obj.get_absolute_url(),
            text=obj.content,
        )
    def setUp(self):
        self.target_object = testfunc.create_mentionable_object()
        self.webmention_source_url = testfunc.random_url()
        self.simplemention_source_url = testfunc.random_url()

        Webmention.objects.create(
            source_url=self.webmention_source_url,
            target_object=self.target_object,
            validated=True,
            approved=True,
        )

        SimpleMention.objects.create(
            source_url=self.simplemention_source_url,
            target_object=self.target_object,
        )
 def setUp(self):
     self.target = testfunc.create_mentionable_object()
     self.target_url = testfunc.get_absolute_url_for_object(self.target)
 def setUp(self):
     _create_mentionable_objects()
     self.target = testfunc.create_mentionable_object()
     _create_mentionable_objects()
def _create_mentionable_objects(n: int = 3):
    """Create some arbitrary mentionable objects for noise."""

    for x in range(n):
        testfunc.create_mentionable_object()