utils

Utilities and helper functions.

Location: allianceauth.utils

cache

get_redis_client() Redis[source]

Get the configured redis client used by Django for caching.

This function is a wrapper designed to work for both AA2 and AA3 and should always be used to ensure backwards compatibility.

testing

class NoSocketsTestCase(methodName='runTest')[source]

Variation of Django’s TestCase class that prevents any network use.

Example

class TestMyStuff(NoSocketsTestCase):
    def test_should_do_what_i_need(self):
        ...
exception SocketAccessError[source]

Error raised when a test script accesses the network