Merge branch 'main' into readthrough-dates
This commit is contained in:
commit
57ef1522b5
26 changed files with 916 additions and 652 deletions
|
@ -82,6 +82,27 @@ class FeedViews(TestCase):
|
|||
|
||||
self.assertEqual(result.status_code, 404)
|
||||
|
||||
def test_status_page_not_found_wrong_user(self, *_):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
view = views.Status.as_view()
|
||||
another_user = models.User.objects.create_user(
|
||||
"rat@local.com",
|
||||
"rat@rat.rat",
|
||||
"password",
|
||||
local=True,
|
||||
localname="rat",
|
||||
)
|
||||
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"):
|
||||
status = models.Status.objects.create(content="hi", user=another_user)
|
||||
|
||||
request = self.factory.get("")
|
||||
request.user = self.local_user
|
||||
with patch("bookwyrm.views.feed.is_api_request") as is_api:
|
||||
is_api.return_value = False
|
||||
result = view(request, "mouse", status.id)
|
||||
|
||||
self.assertEqual(result.status_code, 404)
|
||||
|
||||
def test_status_page_with_image(self, *_):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
view = views.Status.as_view()
|
||||
|
|
|
@ -51,6 +51,16 @@ class UserViews(TestCase):
|
|||
data = json.loads(result.getvalue())
|
||||
self.assertEqual(data["subject"], "acct:mouse@local.com")
|
||||
|
||||
def test_webfinger_case_sensitivty(self):
|
||||
"""ensure that webfinger queries are not case sensitive"""
|
||||
request = self.factory.get("", {"resource": "acct:MoUsE@local.com"})
|
||||
request.user = self.anonymous_user
|
||||
|
||||
result = views.webfinger(request)
|
||||
self.assertIsInstance(result, JsonResponse)
|
||||
data = json.loads(result.getvalue())
|
||||
self.assertEqual(data["subject"], "acct:mouse@local.com")
|
||||
|
||||
def test_nodeinfo_pointer(self):
|
||||
"""just tells you where nodeinfo is"""
|
||||
request = self.factory.get("")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue