Guarded against an inactive user being set as a reviewer or owner of a review request
Review Request #11422 — Created Jan. 30, 2021 and updated
A change that prevents an inactive user to be assigned as a submitter or reviewer for a
unpublished review request. In addition to this, this change will prevent
a review request draft from being published if the submitter or reviewer(s) are inactive.
I've manually validated in the UI for draft review request that an error appears if a user
tries to update the owner/submitter or target people (reviewers) field with an innactive
user-I've created unit tests for when a review request draft is published for the following
cases
1. A review request draft is published with an inactive reviewer
2. A review request draft is published with an inactive owner/submitter
3. A review request draft is published with multiple reviewers, one of which is inactive-I've also created additional unit tests regarrding when a review request draft is updated
using a PUT request
5. A PUT API call is made to update a review request draft with an inactive user set as the
owner/submitter of the review request
7. A PUT API call is made to update a review request draft with an inactive user set as one
8. of the reviewers of the review request
Summary | ID | Author |
---|---|---|
77e175ff12c5c098ec93c8558d6dae2727f06eb6 | mderose123 | |
89d6d608750c529824fc00cce880cf77cbe7ff6d | mderose123 | |
634e91d9a34c6939dfcbf2bf5c358be12b10067c | mderose123 | |
92d0dbb9c1deccdeb6a758b27e377048658e6509 | mderose123 | |
6511fc0ef5068540042210a266bdfe6cdd28859d | mderose123 | |
422334836d31a49b09658c3b4151cdb89960e428 | mderose123 | |
1aca18a7075644c9043ae48365e7e720031f2c08 | mderose123 | |
60348fa225a045f5c33d56ff5ada4c303702af85 | mderose123 | |
ec40c4934a492758547a73cf9c8bf8c18c765203 | mderose123 | |
4b0ae5cdf93a629aab9d4b3a27fffb1eb0046d13 | mderose123 | |
f5f6c7ca54da7bc917503e4a2ecaef991b9558ea | mderose123 |
Description | From | Last Updated |
---|---|---|
W293 blank line contains whitespace |
reviewbot | |
E712 comparison to False should be 'if cond is False:' or 'if not cond:' |
reviewbot | |
E501 line too long (96 > 79 characters) |
reviewbot | |
F812 list comprehension redefines 'user' from line 341 |
reviewbot | |
E202 whitespace before ')' |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E501 line too long (85 > 79 characters) |
reviewbot | |
E501 line too long (86 > 79 characters) |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E711 comparison to None should be 'if cond is not None:' |
reviewbot | |
E712 comparison to False should be 'if cond is False:' or 'if not cond:' |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E501 line too long (82 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
F812 list comprehension redefines 'user' from line 1042 |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E501 line too long (82 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E999 SyntaxError: EOL while scanning string literal |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E999 SyntaxError: EOL while scanning string literal |
reviewbot | |
E501 line too long (80 > 79 characters) |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E128 continuation line under-indented for visual indent |
reviewbot | |
E127 continuation line over-indented for visual indent |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
F812 list comprehension redefines 'user' from line 1042 |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
W291 trailing whitespace |
reviewbot | |
F841 local variable 'draft' is assigned to but never used |
reviewbot | |
E501 line too long (81 > 79 characters) |
reviewbot | |
This file shouldn't be part of your change. |
david | |
I don't know if your editor did this automatically, but there are a bunch of indentation changes to this file … |
david | |
Let's make the iterator variable named "user" rather than "inactive user", since this iterates over all users. It's probably also … |
david | |
The outer parens aren't needed here. We can also just check truthiness on the list instead of checking the length. |
david | |
Hmm. It might be nice to inform the user which users are inactive. |
david | |
Let's call the iterator variable user here too. |
david | |
We can just check truthiness on the list here instead of checking the length. |
david | |
Outer parens aren't needed here. But we do need a space between the "if" and the conditional. These could actually … |
david | |
This blank line isn't necessary. |
david | |
Please revert unintentional indentation changes to this file. |
david | |
Please put this line back. |
david | |
Please put this line back. |
david | |
Let's add a blank line after this. |
david | |
Hmm. I think we want to keep this using found_usernames. Perhaps we can just add the is_active check into the … |
david | |
E501 line too long (96 > 79 characters) |
reviewbot | |
E501 line too long (85 > 79 characters) |
reviewbot | |
E703 statement ends with a semicolon |
reviewbot | |
W293 blank line contains whitespace |
reviewbot | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
We have a standard form for list comprehensions. This should look like: inactive_reviewer_list = [ reviewer for reviewer in reviewer_list … |
chipx86 | |
Blank line between statements and new blocks. |
chipx86 | |
Two important things here: We don't use .format(). It's not always better (technically it's slower than %-based formatting), and more … |
chipx86 | |
We're now iterating through the same list a second time. A better option, normally would be to iterate once and … |
chipx86 | |
Blank line between statements and blocks. |
chipx86 | |
Since we've now done that work of pulling out the active reviewers and checking them, we can avoid performing another … |
chipx86 | |
We've already covered the "active" bit above. I think we should leave this string as-is, since it's confusing when in … |
chipx86 | |
Blank line between statements and blocks. |
chipx86 | |
I think we can word this a bit better. How about: "The owner assigned to this review request cannot be … |
chipx86 | |
The """ must be on a separate line, for multi-line docstrings. Same with ones below. |
chipx86 | |
Can you use self.create_user() instead, and pass in keyword arguments for the values? Same for other tests. |
chipx86 | |
We're setting a whole lot more than we need for the test. This would be fine if we were testing … |
chipx86 | |
Blank line between statements and docs. Same for tests below. |
chipx86 | |
These changes aren't correct, and also aren't relevant to the rest of your change. Can you revert them? |
chipx86 | |
This will need to be in the style I outlined before, for list comprehensions. |
chipx86 | |
This just became expensive. Better to build a list of usernames up-front, and then pass that in. Otherwise, we're rebuilding … |
chipx86 | |
This blank line must remain. |
chipx86 | |
No trailing period for unit test docstrings. The test runner already puts a ... after the docstring, and it looks … |
chipx86 | |
It doesn't look like this is used anywhere. |
chipx86 | |
No need to pass None here. That's the default. Also, a bare None is not self-descriptive at all (it means … |
chipx86 | |
The last entry in a dictionary or list should always have a trailing comma, so that we don't have to … |
chipx86 | |
We have some newer kgb support for checking calls now. Can you replace these with: self.assertSpyNotCalled(ChangeDescription.save) self.assertSpyNotCalled(ReviewRequestDraft.save) Same below. |
chipx86 | |
Doesn't look like we're using this either. |
chipx86 | |
This should use self.assertIn instead. |
chipx86 |
- Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123
Checks run (1 failed, 1 succeeded)
flake8
- Testing Done:
-
- -I've manually validated in the UI for unpublished or published review request that an error appears if a user tries to update the owner or people (reviewers) field with an innactive user
- -I've created unit tests for when a review request is published with the APIS for the following cases
1. A review request draft is published with an inactive reviewer 2. A review request draft is published with an inactive owner/submitter 3. A review request draft is published with multiple reviewers, one of which is inactive Outstanding tests that I need to figure out how to write:
~ -Unit tests for checking if an API call is made to update a review request (or review request draft) with a user with any combination of an inactive reviewer and/or an inactive owner ~ -Unit tests for checking if an API call is made to update a review request (or review request draft) with a user with any combination of an inactive reviewer and/or an inactive owner + -I've manually validated in the UI for draft review request that an error appears if a user tries to update the owner or people (reviewers) field with an innactive user but need to iron out issues that appeared after making flake8 changes - Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123
- Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123
- Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 07d9184b8ef78a6569c5bce98844af2355dc3d6f mderose123 3c55086ca8fbbf3b32c51afc75ac97ad5bd9bd16 mderose123 - Diff:
-
Revision 5 (+433 -131)
- Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 07d9184b8ef78a6569c5bce98844af2355dc3d6f mderose123 3c55086ca8fbbf3b32c51afc75ac97ad5bd9bd16 mderose123 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 07d9184b8ef78a6569c5bce98844af2355dc3d6f mderose123 3c55086ca8fbbf3b32c51afc75ac97ad5bd9bd16 mderose123 e01be77030ddb4f5fe19e5b6db1cf67c9e58be87 mderose123 - Diff:
-
Revision 6 (+440 -136)
Checks run (2 succeeded)
- Description:
-
A change that prevents an inactive user to be assigned as a submitter or reviewer for a
~ published or unpublished review request. In addition to this, this change will prevent ~ unpublished review request. In addition to this, this change will prevent a review request draft from being published if the submitter or reviewer(s) are inactive. - Testing Done:
-
+ I've manually validated in the UI for draft review request that an error appears if a user tries to update the owner/submitter or target people (reviewers) field with an innactive user
+ -I've created unit tests for when a review request is published with the APIS for the following cases
1. A review request draft is published with an inactive reviewer 2. A review request draft is published with an inactive owner/submitter ~ 3. A review request draft is published with multiple reviewers, one of which is inactive ~ ~ Outstanding tests that I need to figure out how to write:
~ 3. A review request draft is published with multiple reviewers, one of which is inactive ~ 4. A PUT API call is made to update a review request draft with an inactive user set as the owner/submitter of the review request ~ 5. A PUT API call is made to update a review request draft with an inactive user set as one of the reviewers of the review request - -Unit tests for checking if an API call is made to update a review request (or review request draft) with a user with any combination of an inactive reviewer and/or an inactive owner - -I've manually validated in the UI for draft review request that an error appears if a user tries to update the owner or people (reviewers) field with an innactive user but need to iron out issues that appeared after making flake8 changes
- Groups:
- Testing Done:
-
I've manually validated in the UI for draft review request that an error appears if a user tries to update the owner/submitter or target people (reviewers) field with an innactive user
~ -I've created unit tests for when a review request is published with the APIS for the following cases
~ -I've created unit tests for when a review request draft is published for the following cases
1. A review request draft is published with an inactive reviewer 2. A review request draft is published with an inactive owner/submitter ~ 3. A review request draft is published with multiple reviewers, one of which is inactive ~ 4. A PUT API call is made to update a review request draft with an inactive user set as the owner/submitter of the review request ~ 5. A PUT API call is made to update a review request draft with an inactive user set as one of the reviewers of the review request ~ 3. A review request draft is published with multiple reviewers, one of which is inactive ~ ~ -I've also created additional unit tests regarrding when a review request draft is updated using a PUT request
+ 5. A PUT API call is made to update a review request draft with an inactive user set as the owner/submitter of the review request + 6. A PUT API call is made to update a review request draft with an inactive user set as one of the reviewers of the review request
-
Great start on this!
-
-
I don't know if your editor did this automatically, but there are a bunch of indentation changes to this file that are unrelated to your fix. Please go through and revert these.
-
Let's make the iterator variable named "user" rather than "inactive user", since this iterates over all users.
It's probably also more readable to have
if not user.is_active
-
The outer parens aren't needed here. We can also just check truthiness on the list instead of checking the length.
-
-
-
-
Outer parens aren't needed here. But we do need a space between the "if" and the conditional. These could actually be combined together:
if owner is not None and not owner.is_active:
-
-
-
-
-
-
Hmm. I think we want to keep this using
found_usernames
. Perhaps we can just add theis_active
check into the list compherension up on lines 1027-1030?
- Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 07d9184b8ef78a6569c5bce98844af2355dc3d6f mderose123 3c55086ca8fbbf3b32c51afc75ac97ad5bd9bd16 mderose123 e01be77030ddb4f5fe19e5b6db1cf67c9e58be87 mderose123 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 07d9184b8ef78a6569c5bce98844af2355dc3d6f mderose123 3c55086ca8fbbf3b32c51afc75ac97ad5bd9bd16 mderose123 e01be77030ddb4f5fe19e5b6db1cf67c9e58be87 mderose123 f3bfde108fe01cc5a0dbca39e94428da686c172b mderose123 - Diff:
-
Revision 7 (+520 -405)
- Commits:
-
Summary ID Author 47a726d9344045966731e7d789ab5b469f96f547 mderose123 55390df0128c8883c6c936d662c191ad1ed72763 mderose123 dfa0445c86ed412ac9e12bdbccf6a2fe0e8ddb59 mderose123 b2694e1d558f70d333d36587503859fa326e2821 mderose123 07d9184b8ef78a6569c5bce98844af2355dc3d6f mderose123 3c55086ca8fbbf3b32c51afc75ac97ad5bd9bd16 mderose123 e01be77030ddb4f5fe19e5b6db1cf67c9e58be87 mderose123 f3bfde108fe01cc5a0dbca39e94428da686c172b mderose123 77e175ff12c5c098ec93c8558d6dae2727f06eb6 mderose123 89d6d608750c529824fc00cce880cf77cbe7ff6d mderose123 634e91d9a34c6939dfcbf2bf5c358be12b10067c mderose123 92d0dbb9c1deccdeb6a758b27e377048658e6509 mderose123 6511fc0ef5068540042210a266bdfe6cdd28859d mderose123 422334836d31a49b09658c3b4151cdb89960e428 mderose123 1aca18a7075644c9043ae48365e7e720031f2c08 mderose123 60348fa225a045f5c33d56ff5ada4c303702af85 mderose123 ec40c4934a492758547a73cf9c8bf8c18c765203 mderose123 - Diff:
-
Revision 8 (+467 -159)
Checks run (2 succeeded)
- Commits:
-
Summary ID Author 77e175ff12c5c098ec93c8558d6dae2727f06eb6 mderose123 89d6d608750c529824fc00cce880cf77cbe7ff6d mderose123 634e91d9a34c6939dfcbf2bf5c358be12b10067c mderose123 92d0dbb9c1deccdeb6a758b27e377048658e6509 mderose123 6511fc0ef5068540042210a266bdfe6cdd28859d mderose123 422334836d31a49b09658c3b4151cdb89960e428 mderose123 1aca18a7075644c9043ae48365e7e720031f2c08 mderose123 60348fa225a045f5c33d56ff5ada4c303702af85 mderose123 ec40c4934a492758547a73cf9c8bf8c18c765203 mderose123 77e175ff12c5c098ec93c8558d6dae2727f06eb6 mderose123 89d6d608750c529824fc00cce880cf77cbe7ff6d mderose123 634e91d9a34c6939dfcbf2bf5c358be12b10067c mderose123 92d0dbb9c1deccdeb6a758b27e377048658e6509 mderose123 6511fc0ef5068540042210a266bdfe6cdd28859d mderose123 422334836d31a49b09658c3b4151cdb89960e428 mderose123 1aca18a7075644c9043ae48365e7e720031f2c08 mderose123 60348fa225a045f5c33d56ff5ada4c303702af85 mderose123 ec40c4934a492758547a73cf9c8bf8c18c765203 mderose123 4b0ae5cdf93a629aab9d4b3a27fffb1eb0046d13 mderose123 - Diff:
-
Revision 9 (+468 -160)
- Commits:
-
Summary ID Author 77e175ff12c5c098ec93c8558d6dae2727f06eb6 mderose123 89d6d608750c529824fc00cce880cf77cbe7ff6d mderose123 634e91d9a34c6939dfcbf2bf5c358be12b10067c mderose123 92d0dbb9c1deccdeb6a758b27e377048658e6509 mderose123 6511fc0ef5068540042210a266bdfe6cdd28859d mderose123 422334836d31a49b09658c3b4151cdb89960e428 mderose123 1aca18a7075644c9043ae48365e7e720031f2c08 mderose123 60348fa225a045f5c33d56ff5ada4c303702af85 mderose123 ec40c4934a492758547a73cf9c8bf8c18c765203 mderose123 4b0ae5cdf93a629aab9d4b3a27fffb1eb0046d13 mderose123 77e175ff12c5c098ec93c8558d6dae2727f06eb6 mderose123 89d6d608750c529824fc00cce880cf77cbe7ff6d mderose123 634e91d9a34c6939dfcbf2bf5c358be12b10067c mderose123 92d0dbb9c1deccdeb6a758b27e377048658e6509 mderose123 6511fc0ef5068540042210a266bdfe6cdd28859d mderose123 422334836d31a49b09658c3b4151cdb89960e428 mderose123 1aca18a7075644c9043ae48365e7e720031f2c08 mderose123 60348fa225a045f5c33d56ff5ada4c303702af85 mderose123 ec40c4934a492758547a73cf9c8bf8c18c765203 mderose123 4b0ae5cdf93a629aab9d4b3a27fffb1eb0046d13 mderose123 f5f6c7ca54da7bc917503e4a2ecaef991b9558ea mderose123 - Diff:
-
Revision 10 (+470 -162)
Checks run (2 succeeded)
- Testing Done:
-
~ I've manually validated in the UI for draft review request that an error appears if a user tries to update the owner/submitter or target people (reviewers) field with an innactive user
~ I've manually validated in the UI for draft review request that an error appears if a user
+ tries to update the owner/submitter or target people (reviewers) field with an innactive + user ~ -I've created unit tests for when a review request draft is published for the following cases
~ -I've created unit tests for when a review request draft is published for the following
+ cases 1. A review request draft is published with an inactive reviewer 2. A review request draft is published with an inactive owner/submitter 3. A review request draft is published with multiple reviewers, one of which is inactive ~ -I've also created additional unit tests regarrding when a review request draft is updated using a PUT request
~ 5. A PUT API call is made to update a review request draft with an inactive user set as the owner/submitter of the review request ~ 6. A PUT API call is made to update a review request draft with an inactive user set as one of the reviewers of the review request ~ -I've also created additional unit tests regarrding when a review request draft is updated
~ using a PUT request ~ 5. A PUT API call is made to update a review request draft with an inactive user set as the + owner/submitter of the review request + 7. A PUT API call is made to update a review request draft with an inactive user set as one + 8. of the reviewers of the review request
-
-
We have a standard form for list comprehensions. This should look like:
inactive_reviewer_list = [ reviewer for reviewer in reviewer_list if not reviewer.is_active ]
Same applies to other sbelow.
-
-
Two important things here:
- We don't use
.format()
. It's not always better (technically it's slower than%
-based formatting), and more than anything, we just don't standardize around using it. So let's use%
. - You're formatting before it goes into
ugettext
, which just won't work. You can't localize a dynamic string. Instead,ugettext
must take a static string, and then you have to format the result of that call.
- We don't use
-
We're now iterating through the same list a second time. A better option, normally would be to iterate once and define both lists.
However, note that we don't care at all about the contents of this list. We know how many inactive reviewers we have, and what the total is. So we can instead do:
has_active_reviewers = (len(reviewer_list) > len(inactive_reviewer_list)
-
-
Since we've now done that work of pulling out the active reviewers and checking them, we can avoid performing another database query (
target_groups.exists()
) if we know we've failed that check. So, let's reverse the order of the things we check in thisif
statement. -
We've already covered the "active" bit above. I think we should leave this string as-is, since it's confusing when in the context of review groups.
-
-
I think we can word this a bit better. How about:
"The owner assigned to this review request cannot be an inactive user."
-
-
Can you use
self.create_user()
instead, and pass in keyword arguments for the values?Same for other tests.
-
We're setting a whole lot more than we need for the test. This would be fine if we were testing that draft publishing worked and that these values propagated to the review request, but we're not. Let's keep the test state minimal.
Same with tests below.
-
-
These changes aren't correct, and also aren't relevant to the rest of your change. Can you revert them?
-
-
This just became expensive.
Better to build a list of usernames up-front, and then pass that in. Otherwise, we're rebuilding the list of usernames for every loop of our list comprehension.
-
-
No trailing period for unit test docstrings. The test runner already puts a
...
after the docstring, and it looks weird to have. ...
Same with test docstrings below.
-
-
No need to pass
None
here. That's the default. Also, a bareNone
is not self-descriptive at all (it means people have to go look up the function signature), so if we did want to pass this, we'd want to do so with a keyword argument.Same below.
-
The last entry in a dictionary or list should always have a trailing comma, so that we don't have to re-modify this line if we add another key.
Same below.
-
We have some newer kgb support for checking calls now. Can you replace these with:
self.assertSpyNotCalled(ChangeDescription.save) self.assertSpyNotCalled(ReviewRequestDraft.save)
Same below.
-
-