Pyflakes
-
reviewboard/accounts/tests.py (Diff revision 1) Show all issues
Review Request #8847 — Created March 26, 2017 and submitted
Information | |
---|---|
khp | |
Review Board | |
master | |
|
|
8861 | |
Reviewers | |
reviewboard, students | |
Read-only mode is a setting an admin can enable to prevent writes to
the database. This can be used when the site is under maintenence or
being upgraded. This commit adds some new documentation on how
extension authors can utilize read-only mode in js and django.
This commit also includes unit testing for the wrapped login_required
decorator and its usage to redirect New Review Request and My
Account when in read-only mode.
Build docs - no problem
Run python tests - pass except a couple that will be fixed in next commit
Description | From | Last Updated |
---|---|---|
"recommended that you enable read-only mode" |
|
|
"enabling read-only mode" instead of "putting the site in read-only mode" |
|
|
into. No comma here. |
|
|
"Review Board" |
|
|
The code should be aligned with the c in code-block, i.e., three spaces (yes, I know it's weird). |
|
|
"into" |
|
|
Just "API requests". |
|
|
How about "When the site is in read-only mode, only changes made to models by superusers will be propagated to … |
|
|
How about "When the site is in read-only mode, only changes made to models by superusers will be propagated to … |
|
|
Wrap readOnly in double-backtickcs so that gets marked as <code>. |
|
|
Likewise here. |
|
|
In JavaScript, this would actually be: if (conditional) { /* Comment */ } The code here also doesnt fit the … |
|
|
Undo this. |
|
|
We don't require docstrings for setUp, tearDown, etc. |
|
|
This can be moved into setUpClass, which only runs once per class, e.g. @classmethod def setUpClass(cls): super(LoginRequiredTest, cls).setUpClass() # ... |
|
|
This should be _mock_view_function. Also your args are in the wrong order. |
|
|
Care to split this up into user & super-user tests? |
|
|
Instead of "the decorator", say Testing @login_required. Same goes for all the tests here. No trailing periods in test docstrings. |
|
|
This comment is |
|
|
Care to split this up into user & super-user tests? |
|
|
Care to split this up into user & super-user tests? |
|
|
""" should be on next line. |
|
|
redefinition of unused 'test_my_account_does_not_redirect_when_not_read_only' from line 647 |
![]() |
|
This should be a phrase in the imperative mode, e.g. """Check response versus the expected value""" Missing args etc |
|
|
Can you split this into new tests? |
|
docs/manual/admin/upgrading/upgrading-reviewboard.rst (Diff revision 1) |
---|
"recommended that you enable read-only mode"
docs/manual/admin/upgrading/upgrading-sites.rst (Diff revision 1) |
---|
"enabling read-only mode" instead of "putting the site in read-only mode"
docs/manual/extending/extensions/class.rst (Diff revision 1) |
---|
The code should be aligned with the
c
incode-block
, i.e., three spaces (yes, I know it's weird).
docs/manual/extending/extensions/js-extensions.rst (Diff revision 1) |
---|
How about
"When the site is in read-only mode, only changes made to models by superusers will be propagated to the server; changes made by all other users will be discarded."
docs/manual/extending/extensions/js-extensions.rst (Diff revision 1) |
---|
How about
"When the site is in read-only mode, only changes made to models by superusers will be propagated to the server; changes made by all other users will be discarded."
docs/manual/extending/extensions/js-extensions.rst (Diff revision 1) |
---|
Wrap
readOnly
in double-backtickcs so that gets marked as<code>
.
docs/manual/extending/extensions/js-extensions.rst (Diff revision 1) |
---|
In JavaScript, this would actually be:
if (conditional) { /* Comment */ }
The code here also doesnt fit the above.
reviewboard/accounts/tests.py (Diff revision 1) |
---|
We don't require docstrings for
setUp
,tearDown
, etc.
reviewboard/accounts/tests.py (Diff revision 1) |
---|
This can be moved into
setUpClass
, which only runs once per class, e.g.@classmethod def setUpClass(cls): super(LoginRequiredTest, cls).setUpClass() # ...
reviewboard/accounts/tests.py (Diff revision 1) |
---|
This should be
_mock_view_function
. Also your args are in the wrong order.
reviewboard/accounts/tests.py (Diff revision 1) |
---|
Instead of "the decorator", say
Testing @login_required
. Same goes for all the tests here.No trailing periods in test docstrings.
reviewboard/accounts/tests.py (Diff revision 1) |
---|
This should be a phrase in the imperative mode, e.g.
"""Check response versus the expected value"""
Missing args etc
Summary: |
|
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||
Testing Done: |
|
|||||||||||||||||||||||||||
Depends On: |
Summary: |
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|