diff options
| author | 2019-10-19 17:17:39 +0200 | |
|---|---|---|
| committer | 2019-10-19 17:17:39 +0200 | |
| commit | 1ce639c6e560ff7aff405ad055e80b78efee8dfc (patch) | |
| tree | 9f1f5cce9e0e47c372daed8764053d22f714a920 /pysite/hosts.py | |
| parent | Solve migration conflict by renaming migrations (diff) | |
Apply feedback for pull request #278
https://github.com/python-discord/site/pull/278
This commit applies the feedback given to PR #278. I have made a
number of significant changes:
- I have added tests for the `MigrationsTestCase` class, including a
  test to see if the test case travels to the specified points in the
  migration history.
- The dictionary of infracted users in the active migration tests now
  uses informative strings as keys. This makes it easier to relate a
  specific test to the data it's testing.
- I have simplified the migration query logic by replacing unneeded Q
  objects by simpler keyword arguments to `filter` method calls.
- I have removed the custom validation logic for allowing only one
  active infraction of a given type per user and replaced it by a
  `UniqueTogetherValidator` with a custom validation error message.
- `test_unique_constraint_accepts_active_infraction_after_inactive_
   infraction` relied on an Error results instead of a Fail result
   to indicate an issue with the database constraint. Since a fail
   should lead to a Fail status, I've replaced it by a try-except
   block that signals a test failure if an `IntegrityError` was
   caught by it.
Diffstat (limited to 'pysite/hosts.py')
0 files changed, 0 insertions, 0 deletions
