From ecd4af15ab29e3a97c3a19aa5705a40c97f0e2c7 Mon Sep 17 00:00:00 2001 From: masci Date: Wed, 5 Feb 2014 13:20:58 +0100 Subject: [PATCH] test coverage for __str__ method in Application model --- oauth2_provider/tests/test_models.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/oauth2_provider/tests/test_models.py b/oauth2_provider/tests/test_models.py index 4e5c1a515..1937a7922 100644 --- a/oauth2_provider/tests/test_models.py +++ b/oauth2_provider/tests/test_models.py @@ -60,3 +60,15 @@ def test_grant_implicit_redirect_uris(self): ) self.assertRaises(ValidationError, app.full_clean) + + def test_str(self): + app = Application( + redirect_uris="", + user=self.user, + client_type=Application.CLIENT_CONFIDENTIAL, + authorization_grant_type=Application.GRANT_IMPLICIT, + ) + self.assertEqual("%s" % app, app.client_id) + + app.name = "test_app" + self.assertEqual("%s" % app, "test_app")