def test_send_friend_invite_again(self):
     send_friend_invite(self.user, "other")
     self.assertEqual(
         self.user.outgoing_friendships.filter(
             to_user=self.other_user).count(), 1)
     send_friend_invite(self.user, "other")
     self.assertEqual(
         self.user.outgoing_friendships.filter(
             to_user=self.other_user).count(), 1)
 def test_send_friend_invite_no_user(self):
     with self.assertRaises(RuntimeError):
         send_friend_invite(self.user, "missinguser")
 def test_send_friend_invite_blocked(self):
     with self.assertRaises(RuntimeError):
         send_friend_invite(self.user, "other")