Various pylint complaince fixes

This commit is contained in:
Mouse Reeve
2022-04-08 14:23:37 -07:00
parent a92bf785dd
commit 9921a1e754
10 changed files with 19 additions and 15 deletions

View File

@ -38,7 +38,7 @@ class BaseModel(TestCase):
def test_remote_id(self):
"""these should be generated"""
self.test_model.id = 1
self.test_model.id = 1 # pylint: disable=invalid-name
expected = self.test_model.get_remote_id()
self.assertEqual(expected, f"https://{DOMAIN}/bookwyrmtestmodel/1")

View File

@ -161,7 +161,7 @@ class ModelFields(TestCase):
@dataclass(init=False)
class TestActivity(ActivityObject):
"""real simple mock"""
# pylint: disbale=invalid-name
to: List[str]
cc: List[str]
id: str = "http://hi.com"

View File

@ -17,7 +17,7 @@ class User(TestCase):
"bookwyrm.activitystreams.populate_stream_task.delay"
), patch("bookwyrm.lists_stream.populate_lists_task.delay"):
self.user = models.User.objects.create_user(
"mouse@%s" % DOMAIN,
f"mouse@{DOMAIN}",
"mouse@mouse.mouse",
"mouseword",
local=True,
@ -107,7 +107,7 @@ class User(TestCase):
def test_get_or_create_remote_server(self):
responses.add(
responses.GET,
"https://%s/.well-known/nodeinfo" % DOMAIN,
f"https://{DOMAIN}/.well-known/nodeinfo",
json={"links": [{"href": "http://www.example.com"}, {}]},
)
responses.add(
@ -124,7 +124,7 @@ class User(TestCase):
@responses.activate
def test_get_or_create_remote_server_no_wellknown(self):
responses.add(
responses.GET, "https://%s/.well-known/nodeinfo" % DOMAIN, status=404
responses.GET, f"https://{DOMAIN}/.well-known/nodeinfo", status=404
)
server = models.user.get_or_create_remote_server(DOMAIN)
@ -136,7 +136,7 @@ class User(TestCase):
def test_get_or_create_remote_server_no_links(self):
responses.add(
responses.GET,
"https://%s/.well-known/nodeinfo" % DOMAIN,
f"https://{DOMAIN}/.well-known/nodeinfo",
json={"links": [{"href": "http://www.example.com"}, {}]},
)
responses.add(responses.GET, "http://www.example.com", status=404)
@ -150,7 +150,7 @@ class User(TestCase):
def test_get_or_create_remote_server_unknown_format(self):
responses.add(
responses.GET,
"https://%s/.well-known/nodeinfo" % DOMAIN,
f"https://{DOMAIN}/.well-known/nodeinfo",
json={"links": [{"href": "http://www.example.com"}, {}]},
)
responses.add(responses.GET, "http://www.example.com", json={"fish": "salmon"})