Skip to content

Commit

Permalink
Update tests to remove client_id from forms
Browse files Browse the repository at this point in the history
  • Loading branch information
blag committed Sep 22, 2024
1 parent 2881416 commit e65aafe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/test_application_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def test_application_registration_user(self):

form_data = {
"name": "Foo app",
"client_id": "client_id",
"client_secret": "client_secret",
"client_type": Application.CLIENT_CONFIDENTIAL,
"redirect_uris": "http://example.com",
"post_logout_redirect_uris": "http://other_example.com",
Expand All @@ -55,7 +53,8 @@ def test_application_registration_user(self):
self.assertEqual(app.user.username, "foo_user")
app = Application.objects.get()
self.assertEqual(app.name, form_data["name"])
self.assertEqual(app.client_id, form_data["client_id"])
self.assertIsNotNone(app.client_id)
self.assertIsNotNone(app.client_secret)
self.assertEqual(app.redirect_uris, form_data["redirect_uris"])
self.assertEqual(app.post_logout_redirect_uris, form_data["post_logout_redirect_uris"])
self.assertEqual(app.client_type, form_data["client_type"])
Expand Down Expand Up @@ -113,7 +112,6 @@ def test_application_update(self):
self.client.login(username="foo_user", password="123456")

form_data = {
"client_id": "new_client_id",
"redirect_uris": "http://new_example.com",
"post_logout_redirect_uris": "http://new_other_example.com",
"client_type": Application.CLIENT_PUBLIC,
Expand All @@ -126,7 +124,6 @@ def test_application_update(self):
self.assertRedirects(response, reverse("oauth2_provider:detail", args=(self.app_foo_1.pk,)))

self.app_foo_1.refresh_from_db()
self.assertEqual(self.app_foo_1.client_id, form_data["client_id"])
self.assertEqual(self.app_foo_1.redirect_uris, form_data["redirect_uris"])
self.assertEqual(self.app_foo_1.post_logout_redirect_uris, form_data["post_logout_redirect_uris"])
self.assertEqual(self.app_foo_1.client_type, form_data["client_type"])
Expand Down

0 comments on commit e65aafe

Please sign in to comment.