File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from collections .abc import Callable
2+
3+ from django .contrib .auth .models import User
4+
5+ from shared .models .nix_evaluation import (
6+ NixDerivation ,
7+ NixMaintainer ,
8+ )
9+ from webview .models import Notification
10+
11+
12+ def test_github_username_changed (
13+ user : User ,
14+ make_maintainer_from_user : Callable [..., NixMaintainer ],
15+ make_drv : Callable [..., NixDerivation ],
16+ make_package_notification : Callable [..., list [Notification ]],
17+ ) -> None :
18+ """
19+ Check that notifications get sent even if the user's GitHub handle changed after first login.
20+ """
21+ maintainer = make_maintainer_from_user (user )
22+ drv = make_drv (maintainer = maintainer )
23+ # GitHub username could have changed between evaluations.
24+ maintainer .github = maintainer .github + "-new"
25+ maintainer .save ()
26+ notifications = make_package_notification (drv )
27+ assert notifications
You can’t perform that action at this time.
0 commit comments