def test_get_user_identifer_local(self, *_): """fall back to the simplest uid available""" self.assertNotEqual(self.user.username, self.user.localname) self.assertEqual(utilities.get_user_identifier(self.user), "mouse")
def test_get_user_identifer_remote(self, *_): """for a remote user, should be their full username""" self.assertEqual(utilities.get_user_identifier(self.remote_user), "*****@*****.**")
def get_mentions(status, user): """people to @ in a reply: the parent and all mentions""" mentions = set([status.user] + list(status.mention_users.all())) return (" ".join("@" + get_user_identifier(m) for m in mentions if not m == user) + " ")