mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-02 05:18:43 +00:00
Adds test for edit view GET request
This commit is contained in:
parent
cca7c9a98a
commit
c4bca42f64
1 changed files with 20 additions and 0 deletions
|
@ -62,3 +62,23 @@ class FederationViews(TestCase):
|
|||
view(request, server.id)
|
||||
server.refresh_from_db()
|
||||
self.assertEqual(server.status, "federated")
|
||||
|
||||
def test_edit_view_get(self):
|
||||
""" there are so many views, this just makes sure it LOADS """
|
||||
# create mode
|
||||
view = views.EditFederatedServer.as_view()
|
||||
request = self.factory.get("")
|
||||
request.user = self.local_user
|
||||
request.user.is_superuser = True
|
||||
|
||||
result = view(request, server=None)
|
||||
self.assertIsInstance(result, TemplateResponse)
|
||||
result.render()
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
# edit mode
|
||||
server = models.FederatedServer.objects.create(server_name="hi.there.com")
|
||||
result = view(request, server=server.id)
|
||||
self.assertIsInstance(result, TemplateResponse)
|
||||
result.render()
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
|
Loading…
Reference in a new issue