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

More templatetags #165

Merged
merged 8 commits into from
Oct 5, 2023
Merged

More templatetags #165

merged 8 commits into from
Oct 5, 2023

Conversation

blag
Copy link
Contributor

@blag blag commented Sep 19, 2023

Re-implement #133.

Description

Add the platform and browser template tags, and utilize them within the device template tag.

Motivation and Context

This makes it easier to separate pieces of a user agent when displaying to a user.

Closes #133.

How Has This Been Tested?

Added tests for each new template tag. The data for the tests is the same data as for the device tag, since it uses the same data.

I completely decoupled the three test cases (PlatformTemplateFilterTest, BrowserTemplateFilterTest, and DeviceTemplateFilterTest) since I didn't want changes to one to affect the other.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #165 (2130fe5) into master (322c88b) will increase coverage by 0.79%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
+ Coverage   91.82%   92.62%   +0.79%     
==========================================
  Files          16       16              
  Lines         673      746      +73     
  Branches       48       50       +2     
==========================================
+ Hits          618      691      +73     
  Misses         45       45              
  Partials       10       10              
Files Coverage Δ
tests/tests.py 98.36% <100.00%> (+0.32%) ⬆️
user_sessions/templatetags/user_sessions.py 71.66% <100.00%> (+4.35%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@WhyNotHugo WhyNotHugo left a comment

Choose a reason for hiding this comment

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

LGTM. No obvious issues here.

docs/usage.rst Outdated Show resolved Hide resolved
@blag blag merged commit 8ebdfe8 into master Oct 5, 2023
34 of 35 checks passed
@blag blag deleted the more-templatetags branch October 5, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants