def test_reason(monkeypatch):
 def has_reason(ids, force, reason):
  assert (reason == 'expiry')
 monkeypatch.setattr(SIGN_ADDONS, has_reason)
 call_command('sign_addons', 123, reason='expiry')

def test_reason ( monkeypatch ) : def has_reason ( ids , force , reason ) : assert ( reason == 'expiry' ) monkeypatch . setattr ( SIGN_ADDONS , has_reason ) call_command ( 'sign_addons' , 123 , reason = 'expiry' )
you can pass a reason .