From e672322ca871ea52752600099f959b13fc073062 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sun, 26 Nov 2023 13:51:49 +0100 Subject: [PATCH] [MODERATION] User blocking (squash) do not use shared fixture It conflicts with a fixtured added in the commit Fix comment permissions (#28213) (#28216) --- models/fixtures/comment.yml | 9 --------- tests/integration/block_test.go | 3 ++- tests/integration/fixtures/TestBlockActions/comment.yml | 9 +++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 tests/integration/fixtures/TestBlockActions/comment.yml diff --git a/models/fixtures/comment.yml b/models/fixtures/comment.yml index 28381eb4b0..bd64680c8c 100644 --- a/models/fixtures/comment.yml +++ b/models/fixtures/comment.yml @@ -66,12 +66,3 @@ tree_path: "README.md" created_unix: 946684812 invalidated: true - -- - id: 8 - type: 0 # comment - poster_id: 2 - issue_id: 4 # in repo_id 2 - content: "I just wanted to add.." - created_unix: 946684812 - updated_unix: 946684812 diff --git a/tests/integration/block_test.go b/tests/integration/block_test.go index 41b3859e46..70e3fc08a5 100644 --- a/tests/integration/block_test.go +++ b/tests/integration/block_test.go @@ -158,6 +158,7 @@ func TestBlockUserFromOrganization(t *testing.T) { // and as a blocked user and are handled cleanly after the blocking has taken // place. func TestBlockActions(t *testing.T) { + defer tests.AddFixtures("tests/integration/fixtures/TestBlockActions/")() defer tests.PrepareTestEnv(t)() doer := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) @@ -264,7 +265,7 @@ func TestBlockActions(t *testing.T) { t.Run("On a comment", func(t *testing.T) { defer tests.PrintCurrentTest(t)() - comment := unittest.AssertExistsAndLoadBean(t, &issue_model.Comment{ID: 8, PosterID: doer.ID, IssueID: issue4.ID}) + comment := unittest.AssertExistsAndLoadBean(t, &issue_model.Comment{ID: 1008, PosterID: doer.ID, IssueID: issue4.ID}) session := loginUser(t, blockedUser.Name) diff --git a/tests/integration/fixtures/TestBlockActions/comment.yml b/tests/integration/fixtures/TestBlockActions/comment.yml new file mode 100644 index 0000000000..bf5bc3486c --- /dev/null +++ b/tests/integration/fixtures/TestBlockActions/comment.yml @@ -0,0 +1,9 @@ + +- + id: 1008 + type: 0 # comment + poster_id: 2 + issue_id: 4 # in repo_id 2 + content: "comment in private pository" + created_unix: 946684811 + updated_unix: 946684811