@@ -11,7 +11,7 @@ def test_shelter_repo_sync(mocker):
11
11
12
12
# this triggers the publish via Django signals
13
13
repo = RepositoryFactory (
14
- repoid = 91728376 , author = OwnerFactory (ownerid = 555 ), active = False , activated = False
14
+ repoid = 91728376 , author = OwnerFactory (ownerid = 555 ), private = False
15
15
)
16
16
17
17
# triggers publish on create
@@ -47,19 +47,28 @@ def test_shelter_repo_sync(mocker):
47
47
publish_calls = publish .call_args_list
48
48
assert len (publish_calls ) == 3
49
49
50
- # Triggers call when active is changed
51
- repo .active = True
50
+ # Triggers call when owner is changed
51
+ repo .author = OwnerFactory ( ownerid = 888 )
52
52
repo .save ()
53
53
54
54
publish_calls = publish .call_args_list
55
- assert len (publish_calls ) == 4
55
+ # 1 is for the new owner created
56
+ assert len (publish_calls ) == 5
57
+ publish .assert_has_calls (
58
+ [
59
+ call (
60
+ "projects/test-project-id/topics/test-topic-id" ,
61
+ b'{"type": "owner", "sync": "one", "id": 888}' ,
62
+ ),
63
+ ]
64
+ )
56
65
57
- # Triggers call when activated is changed
58
- repo .activated = True
66
+ # Triggers call when private is changed
67
+ repo .private = True
59
68
repo .save ()
60
69
61
- publish_calls = publish .call_args_list
62
- assert len (publish_calls ) == 5
70
+ # publish_calls = publish.call_args_list
71
+ assert len (publish_calls ) == 6
63
72
64
73
65
74
@pytest .mark .django_db
0 commit comments