Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#898 Added the ability to customize classes for django admin #904

Merged
merged 8 commits into from
Dec 16, 2020

Conversation

folt
Copy link
Contributor

@folt folt commented Dec 11, 2020

Fixes #

Description of the Change

#898 Added the ability to customize classes for django admin

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@coveralls
Copy link

coveralls commented Dec 12, 2020

Pull Request Test Coverage Report for Build 1518

  • 55 of 60 (91.67%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 95.014%

Changes Missing Coverage Covered Lines Changed/Added Lines %
oauth2_provider/settings.py 27 32 84.38%
Totals Coverage Status
Change from base Build 1505: 0.2%
Covered Lines: 1334
Relevant Lines: 1404

💛 - Coveralls

@auvipy auvipy requested a review from n2ygk December 12, 2020 15:22
@MattBlack85
Copy link
Contributor

@folt the PR looks good to me but I can't see any test for a custom admin class, could you add one for that case also?

@@ -128,13 +134,13 @@ class OAuth2ProviderSettings:

def __init__(self, user_settings=None, defaults=None, import_strings=None, mandatory=None):
self.user_settings = user_settings or {}
self.defaults = defaults or {}
self.import_strings = import_strings or ()
self.defaults = defaults or DEFAULTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you decided to pass DEFAULTS if we're not passing anything? This looks legit to me, tho I am wondering why it was {} and not DEFAULTS before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the library settings are very similar to the django-rest-framework settings.
My changes are inspired from there

This will allow tests to cover configuration errors. Previously, there were no tests for settings at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, thanks!

@folt
Copy link
Contributor Author

folt commented Dec 14, 2020

@folt the PR looks good to me but I can't see any test for a custom admin class, could you add one for that case also?

A good idea. I will add PR for this case

@MattBlack85 MattBlack85 merged commit 86e78b9 into jazzband:master Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants