# 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():


from django.test import TestCase
from django.contrib.auth.models import User
from django.core.management import call_command
from iprestrict import models
# -*- coding: utf-8 -*-
from __future__ import unicode_literals




class ReloadByViewTest(TestCase):
    IP = '192.168.1.1'

    def setUp(self):
        admin = User.objects.create_user('admin', 'admin@nohost.org', 'pass')
        admin.is_staff = True
        admin.is_superuser = True
        admin.save()
        models.ReloadRulesRequest.request_reload()

    def add_allow_rule(self):

# 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: tests/test_reloading.py
from django.test import TestCase
from django.contrib.auth.models import User
from django.core.management import call_command
from iprestrict import models

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




class ReloadByViewTest(TestCase):
    IP = '192.168.1.1'

    def setUp(self):
        admin = User.objects.create_user('admin', 'admin@nohost.org', 'pass')
        admin.is_staff = True
        admin.is_superuser = True
        admin.save()
        models.ReloadRulesRequest.request_reload()

    def add_allow_rule(self):

        localip = models.RangeBasedIPGroup.objects.create(name='Local IP')