def METHOD_NAME(self):
    # test adding valid ip addresses
    # should be able to do both ipv4 and ipv6
    # spacing should not matter
    form_data = {
        'whitelist': '127.0.0.1, 2003:dead:beef:4dad:23:46:bb:101, 1.1.0.1/32, 1.0.0.0/24',
        'blacklist': '  18.244.1.5  ,  2002:c0a8:101::42, 18.36.22.1, 1.0.0.0/16'
    }
    form = IPFilterForm(data=form_data)
    assert form.is_valid()
    form.save()
    whitelist = IPFilter.current().whitelist_ips
    blacklist = IPFilter.current().blacklist_ips
    for addr in '127.0.0.1, 2003:dead:beef:4dad:23:46:bb:101'.split(','):
        assert addr.strip() in whitelist
    for addr in '18.244.1.5, 2002:c0a8:101::42, 18.36.22.1'.split(','):
        assert addr.strip() in blacklist
    # Network tests
    # ips not in whitelist network
    for addr in ['1.1.0.2', '1.0.1.0']:
        assert addr.strip() not in whitelist
    # ips in whitelist network
    for addr in ['1.1.0.1', '1.0.0.100']:
        assert addr.strip() in whitelist
    # ips not in blacklist network
    for addr in ['2.0.0.0', '1.1.0.0']:
        assert addr.strip() not in blacklist
    # ips in blacklist network
    for addr in ['1.0.100.0', '1.0.0.10']:
        assert addr.strip() in blacklist
    # Test clearing by adding an empty list is OK too
    form_data = {
        'whitelist': '',
        'blacklist': ''
    }
    form = IPFilterForm(data=form_data)
    assert form.is_valid()
    form.save()
    assert len(IPFilter.current().whitelist) == 0
    assert len(IPFilter.current().blacklist) == 0