def test_allowBroadcast(self):
        """
        L{IListeningPort.setBroadcastAllowed} sets broadcast to be allowed
        on the socket.
        """
        reactor = self.buildReactor()
        port = self.getListeningPort(reactor, DatagramProtocol())
        port.setBroadcastAllowed(True)
        self.assertTrue(port.getBroadcastAllowed())

        L{IListeningPort.setBroadcastAllowed} sets broadcast to be allowed
        on the socket.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_udp.py