from unittest.mock import call


def test(args=None):
    """
    Runs the tests.
    """
    module = getattr(args, 'module', '')
    if module == '':
        module = 'tests'
    else:
        module = 'tests.{}'.format(module)
    return call("DJANGO_SETTINGS_MODULE='tests.settings' coverage run "
                "./manage.py test {}".format(module))