# Path: iprestrict/models.py
# TYPE_LOCATION = 'location'
# TYPE_RANGE = 'range'
#     TYPE_CHOICES = ((TYPE_LOCATION, 'Location based'),
#                     (TYPE_RANGE, 'Range based'))
#     TYPE = None
#     TYPE = TYPE_RANGE
#     TYPE = TYPE_LOCATION
#     ACTION_CHOICES = (
#         ('A', 'ALLOW'),
#         ('D', 'DENY')
#     )
# class IPGroupManager(models.Manager):
# class IPGroup(models.Model):
#     class Meta:
# class RangeBasedIPGroup(IPGroup):
#     class Meta:
# class LocationBasedIPGroup(IPGroup):
#     class Meta:
# class IPRange(models.Model):
#     class Meta:
# class IPLocation(models.Model):
#     class Meta:
# class Rule(models.Model):
#     class Meta:
# class ReloadRulesRequest(models.Model):
#     def get_queryset(self):
#     def __init__(self, *args, **kwargs):
#     def load(self):
#     def save(self, *args, **kwargs):
#     def __str__(self):
# def typed_ip_group(ip_group):
#     def load_ranges(self):
#     def ranges(self, ip_type=None):
#     def matches(self, ip):
#     def details_str(self):
#     def load_locations(self):
#     def matches(self, ip):
#     def details_str(self):
#     def start(self):
#     def end(self):
#     def ip_type(self):
#     def __contains__(self, ip):
#     def __str__(self):
#     def __contains__(self, country_code):
#     def __str__(self):
#     def __init__(self, *args, **kwargs):
#     def regex(self):
#     def matches_url(self, url):
#     def matches_ip(self, ip):
#     def is_restricted(self):
#     def is_allowed(self):
#     def action_str(self):
#     def swap_with_rule(self, other):
#     def move_up(self):
#     def move_up_url(self):
#     def move_down_url(self):
#     def move_down(self):
#     def save(self, *args, **kwargs):
#     def request_reload(cls):
#     def last_request():
# 
# Path: iprestrict/ip_utils.py
# def get_version(ip):
# def is_ipv4(ip):
# def is_ipv6(ip):
# def to_number(ip):
# def ipv4_to_number(ip):
# def ipv6_to_number(ip):
# def explode(ip):
# def convert_mixed(ip):
# def to_ip(number, version=IPv4):
# def cidr_to_range(ip, prefix_length):
# def _ip_to_number(ip, separator='.', group_size=2 ** 8, base=10):
# def reject_empty(l):


from django.test import TestCase
from django.core.management.base import CommandError
from django.core.management import call_command
from iprestrict import models
from iprestrict import ip_utils as ipu
# -*- coding: utf-8 -*-
from __future__ import unicode_literals




class AddIPToIPGroupTest(TestCase):
    CMD = 'add_ip_to_group'

    def setUp(self):
        self.BLACKLIST = 'Blacklist'
        self.IP1 = '192.168.222.1'
        self.IP2 = '10.10.10.10'
        self.IPv6 = '2001:db8:85a3::8a2e:0370:7334'
        self.group = models.RangeBasedIPGroup.objects.create(name=self.BLACKLIST)

# Path: iprestrict/models.py
# TYPE_LOCATION = 'location'
# TYPE_RANGE = 'range'
#     TYPE_CHOICES = ((TYPE_LOCATION, 'Location based'),
#                     (TYPE_RANGE, 'Range based'))
#     TYPE = None
#     TYPE = TYPE_RANGE
#     TYPE = TYPE_LOCATION
#     ACTION_CHOICES = (
#         ('A', 'ALLOW'),
#         ('D', 'DENY')
#     )
# class IPGroupManager(models.Manager):
# class IPGroup(models.Model):
#     class Meta:
# class RangeBasedIPGroup(IPGroup):
#     class Meta:
# class LocationBasedIPGroup(IPGroup):
#     class Meta:
# class IPRange(models.Model):
#     class Meta:
# class IPLocation(models.Model):
#     class Meta:
# class Rule(models.Model):
#     class Meta:
# class ReloadRulesRequest(models.Model):
#     def get_queryset(self):
#     def __init__(self, *args, **kwargs):
#     def load(self):
#     def save(self, *args, **kwargs):
#     def __str__(self):
# def typed_ip_group(ip_group):
#     def load_ranges(self):
#     def ranges(self, ip_type=None):
#     def matches(self, ip):
#     def details_str(self):
#     def load_locations(self):
#     def matches(self, ip):
#     def details_str(self):
#     def start(self):
#     def end(self):
#     def ip_type(self):
#     def __contains__(self, ip):
#     def __str__(self):
#     def __contains__(self, country_code):
#     def __str__(self):
#     def __init__(self, *args, **kwargs):
#     def regex(self):
#     def matches_url(self, url):
#     def matches_ip(self, ip):
#     def is_restricted(self):
#     def is_allowed(self):
#     def action_str(self):
#     def swap_with_rule(self, other):
#     def move_up(self):
#     def move_up_url(self):
#     def move_down_url(self):
#     def move_down(self):
#     def save(self, *args, **kwargs):
#     def request_reload(cls):
#     def last_request():
# 
# Path: iprestrict/ip_utils.py
# def get_version(ip):
# def is_ipv4(ip):
# def is_ipv6(ip):
# def to_number(ip):
# def ipv4_to_number(ip):
# def ipv6_to_number(ip):
# def explode(ip):
# def convert_mixed(ip):
# def to_ip(number, version=IPv4):
# def cidr_to_range(ip, prefix_length):
# def _ip_to_number(ip, separator='.', group_size=2 ** 8, base=10):
# def reject_empty(l):


# Path: tests/test_commands.py
from django.test import TestCase
from django.core.management.base import CommandError
from django.core.management import call_command
from iprestrict import models
from iprestrict import ip_utils as ipu

# -*- coding: utf-8 -*-
from __future__ import unicode_literals




class AddIPToIPGroupTest(TestCase):
    CMD = 'add_ip_to_group'

    def setUp(self):
        self.BLACKLIST = 'Blacklist'
        self.IP1 = '192.168.222.1'
        self.IP2 = '10.10.10.10'
        self.IPv6 = '2001:db8:85a3::8a2e:0370:7334'
        self.group = models.RangeBasedIPGroup.objects.create(name=self.BLACKLIST)

        self.group = models.LocationBasedIPGroup.objects.create(name='locations')