tests: add coverage for models migration helpers (#18162)

They were previously not covered at all, either by integration tests or unit tests.

This PR also fixes a bug where the `num_comments` field was incorrectly set to include all types of comments.

It sets num_closed_issues: 0 as default in milestone unit test fixtures. If they are not set, Incr("num_closed_issues") will be a noop because the field is null.
This commit is contained in:
Aravinth Manivannan 2022-01-03 15:35:01 +00:00 committed by GitHub
parent f499f23039
commit ade41f3f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 173 additions and 1 deletions

View file

@ -5,6 +5,7 @@
content: content1
is_closed: false
num_issues: 1
num_closed_issues: 0
-
id: 2
@ -13,6 +14,7 @@
content: content2
is_closed: false
num_issues: 0
num_closed_issues: 0
-
id: 3
@ -21,6 +23,7 @@
content: content3
is_closed: true
num_issues: 1
num_closed_issues: 0
-
id: 4
@ -29,6 +32,7 @@
content: content random
is_closed: false
num_issues: 0
num_closed_issues: 0
-
id: 5
@ -37,3 +41,4 @@
content: for testing with PRs
is_closed: false
num_issues: 0
num_closed_issues: 0