Changeset - b457d9466ee7
[Not reviewed]
0.3
0 7 0
Branko Majic (branko) - 8 years ago 2017-12-20 16:43:47
branko@majic.rs
Grafted from: f03d215e52f1
CONNT-32: Fix incorrect version requirement for Django Crispy Forms:

- Implemented test helper for verifying that no exceptions are thrown when
responses are being rendered.
- Updated all tests related to views that render responses to use the new
mixin.
- Updated development requiremnts to use correct version of package.
- Updated setup script ti require lower version of package.
7 files changed with 100 insertions and 24 deletions:
0 comments (0 inline, 0 general)
conntrackt/tests/helpers.py
Show inline comments
 
@@ -175,12 +175,64 @@ class FakeMessages(object):
 
        Initalises the message framework mocker.
 

	
 
        Set-ups the messages list prpoperty.
 
        """
 
        self.messages = []
 

	
 
    def add(self, level, message, extra_tags):
 
        """
 
        Adds a message.
 
        """
 

	
 
        self.messages.append(message)
 

	
 

	
 
class RenderTestMixin(object):
 
    """
 
    Mixin class for testing that response rendering works correctly.
 

	
 
    In order to use this mixin, add it the left side of the class list the test
 
    is inheriting from, and configure it providing the following class options:
 

	
 
    view_class - Class used for the CBV that will be tested.
 
    view_function - View function that will be tested.
 
    render_test_view_args - Positional arguments to pass to the view.
 
    render_test_view_kwargs - Keyword arguments to pass to the view.
 
    """
 

	
 
    view_class = None
 
    view_function = None
 
    render_test_view_args = ()
 
    render_test_view_kwargs = {}
 

	
 
    def __init__(self, *args, **kwargs):
 
        """
 
        Initialises the mixin. Takes care of some basic validation of
 
        passed configuration options.
 
        """
 

	
 
        super(RenderTestMixin, self).__init__(*args, **kwargs)
 

	
 
        if self.view_class is None and self.view_function is None:
 
            raise ValueError("Render test mixin configured improperly - no CBV class or function was supplied via parameters 'view_class' or 'view_function'.")
 

	
 
        if type(self.render_test_view_kwargs) is not dict:
 
            raise ValueError("Render test mixin configured improperly - parameter 'render_test_view_kwargs' must be a dictionary.")
 

	
 
        if type(self.render_test_view_args) is not tuple:
 
            raise ValueError("Render test mixin configured improperly - parameter 'render_test_view_args' must be a tuple.")
 

	
 
    def test_no_render_exception_thrown_on_GET(self):
 

	
 
        # Get the view.
 
        if self.view_class is not None:
 
            view = self.view_class.as_view()
 
        elif self.view_function is not None:
 
            view = self.view_function
 

	
 
        # Grab the response.
 
        args = self.render_test_view_args
 
        kwargs = self.render_test_view_kwargs
 
        response = generate_get_response(view, *args, **kwargs)
 

	
 
        # Should not raise.
 
        response.render()
conntrackt/tests/test_views.py
Show inline comments
 
@@ -40,30 +40,30 @@ from conntrackt.models import Project, L
 

	
 
from conntrackt.views import IndexView, SearchView, APISearchView
 
from conntrackt.views import entity_iptables, project_iptables, project_diagram
 

	
 
from conntrackt.views import ProjectView, ProjectCreateView, ProjectUpdateView, ProjectDeleteView
 
from conntrackt.views import LocationCreateView, LocationUpdateView, LocationDeleteView
 
from conntrackt.views import EntityView, EntityCreateView, EntityUpdateView, EntityDeleteView
 
from conntrackt.views import InterfaceCreateView, InterfaceUpdateView, InterfaceDeleteView
 
from conntrackt.views import CommunicationCreateView, CommunicationUpdateView, CommunicationDeleteView
 

	
 
# Test imports.
 
from .forms import FormWithWidgetCSSClassFormMixin, FormWithPlaceholderFormMixin
 
from .helpers import PermissionTestMixin, create_get_request, generate_get_response, FakeMessages
 
from .helpers import PermissionTestMixin, RenderTestMixin, create_get_request, generate_get_response, FakeMessages
 
from .views import RedirectToNextMixinView
 
from .factories import setup_test_data
 

	
 

	
 
class IndexViewTest(PermissionTestMixin, TestCase):
 
class IndexViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    sufficient_permissions = ("view",)
 
    view_class = IndexView
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context_no_projects(self):
 
@@ -121,28 +121,29 @@ class IndexViewTest(PermissionTestMixin,
 
        """
 

	
 
        # Get the view.
 
        view = IndexView.as_view()
 

	
 
        # Get the response.
 
        response = generate_get_response(view)
 

	
 
        # Validate the response.
 
        self.assertQuerysetEqual(response.context_data["locations"], ["<Location: Test Location 1>", "<Location: Test Location 2>"])
 

	
 

	
 
class ProjectViewTest(PermissionTestMixin, TestCase):
 
class ProjectViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    sufficient_permissions = ("view",)
 
    permission_test_view_kwargs = {"pk": "1"}
 
    render_test_view_kwargs = {"pk": "1"}
 
    view_class = ProjectView
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called.
 
@@ -174,29 +175,30 @@ class ProjectViewTest(PermissionTestMixi
 

	
 
        # Validate context data.
 
        self.assertEqual(location.name, "Test Location 2")
 
        self.assertQuerysetEqual(entities, expected_entities)
 

	
 
        # Validate context data.
 
        self.assertEqual(str(response.context_data["project"]), "Test Project 1")
 

	
 
        # Validate context data is present.
 
        self.assertIn("communications", response.context_data.keys())
 

	
 

	
 
class EntityViewTest(PermissionTestMixin, TestCase):
 
class EntityViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = EntityView
 
    sufficient_permissions = ("view",)
 
    permission_test_view_kwargs = {"pk": "1"}
 
    render_test_view_kwargs = {"pk": "1"}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Tests if the form comes pre-populated with proper content.
 
        """
 
@@ -224,24 +226,25 @@ class EntityViewTest(PermissionTestMixin
 
        self.assertQuerysetEqual(response.context_data["interfaces"], expected_interfaces)
 
        self.assertQuerysetEqual(response.context_data["incoming_communications"], expected_incoming_communications)
 
        self.assertQuerysetEqual(response.context_data["outgoing_communications"], expected_outgoing_communications)
 
        self.assertEqual(response.context_data["entity"], expected_entity)
 
        self.assertTrue("entity_iptables" in response.context_data)
 

	
 

	
 
class EntityIptablesTest(PermissionTestMixin, TestCase):
 

	
 
    view_function = staticmethod(entity_iptables)
 
    sufficient_permissions = ("view",)
 
    permission_test_view_kwargs = {"pk": "1"}
 
    render_test_view_kwargs = {"pk": "1"}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_invalid_entity(self):
 
        """
 
        Tests if a 404 is returned if no entity was found (invalid ID).
 
        """
 
@@ -293,24 +296,25 @@ class EntityIptablesTest(PermissionTestM
 
        response = generate_get_response(view, pk=1)
 

	
 
        self.assertContains(response, ":INPUT")
 
        self.assertContains(response, ":OUTPUT")
 
        self.assertContains(response, ":FORWARD")
 

	
 

	
 
class ProjectIptablesTest(PermissionTestMixin, TestCase):
 

	
 
    view_function = staticmethod(project_iptables)
 
    sufficient_permissions = ("view",)
 
    permission_test_view_kwargs = {"project_id": 1}
 
    render_test_view_kwargs = {"project_id": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_invalid_project(self):
 
        """
 
        Tests if a 404 is returned if no project was found (invalid ID).
 
        """
 
@@ -421,64 +425,66 @@ class ProjectIptablesTest(PermissionTest
 
        self.assertEqual(len(zipped_iptables.namelist()), 2)
 
        self.assertEqual(zipped_iptables.namelist(), expected_zip_files)
 

	
 
        for filename in expected_zip_files:
 
            iptables_file = zipped_iptables.read(filename)
 
            self.assertIn(":INPUT", iptables_file)
 
            self.assertIn(":OUTPUT", iptables_file)
 
            self.assertIn(":FORWARD", iptables_file)
 

	
 
        zipped_iptables.close()
 

	
 

	
 
class ProjectCreateViewTest(PermissionTestMixin, TestCase):
 
class ProjectCreateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = ProjectCreateView
 
    sufficient_permissions = ("add_project",)
 

	
 

	
 
class ProjectUpdateViewTest(PermissionTestMixin, TestCase):
 
class ProjectUpdateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = ProjectUpdateView
 
    sufficient_permissions = ("change_project",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific project.
 
        """
 

	
 
        # Get the view.
 
        view = ProjectUpdateView.as_view()
 

	
 
        # Get the response.
 
        response = generate_get_response(view, None, pk=1)
 

	
 
        self.assertEqual(response.context_data["project"].name, "Test Project 1")
 
        self.assertEqual(response.context_data["headline"], "Update project Test Project 1")
 

	
 

	
 
class ProjectDeleteViewTest(PermissionTestMixin, TestCase):
 
class ProjectDeleteViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = ProjectDeleteView
 
    sufficient_permissions = ("delete_project",)
 
    permission_test_view_kwargs = {"pk": "1"}
 
    render_test_view_kwargs = {"pk": "1"}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific project.
 
@@ -507,64 +513,66 @@ class ProjectDeleteViewTest(PermissionTe
 
        # Generate the request.
 
        request = RequestFactory().post("/fake-path/")
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 
        request._messages = FakeMessages()
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertIn("Project Test Project 1 has been removed.", request._messages.messages)
 

	
 

	
 
class LocationCreateViewTest(PermissionTestMixin, TestCase):
 
class LocationCreateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = LocationCreateView
 
    sufficient_permissions = ("add_location",)
 

	
 

	
 
class LocationUpdateViewTest(PermissionTestMixin, TestCase):
 
class LocationUpdateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = LocationUpdateView
 
    sufficient_permissions = ("change_location",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific location.
 
        """
 

	
 
        # Get the view.
 
        view = LocationUpdateView.as_view()
 

	
 
        # Get the response.
 
        response = generate_get_response(view, None, pk=1)
 

	
 
        self.assertEqual(response.context_data["location"].name, "Test Location 1")
 
        self.assertEqual(response.context_data["headline"], "Update location Test Location 1")
 

	
 

	
 
class LocationDeleteViewTest(PermissionTestMixin, TestCase):
 
class LocationDeleteViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = LocationDeleteView
 
    sufficient_permissions = ("delete_location",)
 
    permission_test_view_kwargs = {"pk": "1"}
 
    render_test_view_kwargs = {"pk": "1"}    
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific location.
 
@@ -594,25 +602,25 @@ class LocationDeleteViewTest(PermissionT
 
        request = RequestFactory().post("/fake-path/")
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 

	
 
        request._messages = FakeMessages()
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertIn("Location Test Location 1 has been removed.", request._messages.messages)
 

	
 

	
 
class EntityCreateViewTest(PermissionTestMixin, TestCase):
 
class EntityCreateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = EntityCreateView
 
    sufficient_permissions = ("add_entity",)
 

	
 
    def setUp(self):
 
        """
 
        Sets-up some data necessary for testing.
 
        """
 

	
 
        # Set-up some data for testing.
 
        Project.objects.create(name="Test Project 1", description="This is test project 1.")
 
        Project.objects.create(name="Test Project 2", description="This is test project 2.")
 
@@ -671,29 +679,30 @@ class EntityCreateViewTest(PermissionTes
 
        as part of GET parameters.
 
        """
 

	
 
        view = EntityCreateView()
 
        view.request = RequestFactory().get("/fake-path?location=1")
 
        view.object = None
 

	
 
        initial = view.get_initial()
 

	
 
        self.assertDictContainsSubset({"location": "1"}, initial)
 

	
 

	
 
class EntityDeleteViewTest(PermissionTestMixin, TestCase):
 
class EntityDeleteViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = EntityDeleteView
 
    sufficient_permissions = ("delete_entity",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific entity.
 
@@ -742,54 +751,55 @@ class EntityDeleteViewTest(PermissionTes
 
        # Generate the request
 
        request = RequestFactory().post("/fake-path/")
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 
        request._messages = FakeMessages()
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertEqual(response["Location"], reverse("project", args=(1,)))
 

	
 

	
 
class EntityUpdateViewTest(PermissionTestMixin, TestCase):
 
class EntityUpdateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = EntityUpdateView
 
    sufficient_permissions = ("change_entity",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific entity.
 
        """
 

	
 
        # Get the view.
 
        view = EntityUpdateView.as_view()
 

	
 
        # Get the response.
 
        response = generate_get_response(view, None, pk=1)
 

	
 
        self.assertEqual(response.context_data["entity"].name, "Test Entity 1")
 
        self.assertEqual(response.context_data["headline"], "Update entity Test Entity 1")
 

	
 

	
 
class InterfaceCreateViewTest(PermissionTestMixin, TestCase):
 
class InterfaceCreateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = InterfaceCreateView
 
    sufficient_permissions = ("add_interface",)
 

	
 
    def setUp(self):
 
        """
 
        Sets-up some data necessary for testing.
 
        """
 

	
 
        # Set-up some data for testing.
 
        project = Project.objects.create(name="Test Project", description="This is test project.")
 
        location = Location.objects.create(name="Test Location", description="This is test location.")
 
@@ -841,29 +851,30 @@ class InterfaceCreateViewTest(Permission
 
                     "netmask": "255.255.255.255"}
 
        request = RequestFactory().post("/fake-path/", data=post_data)
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertEqual(response["Location"], reverse("entity", args=(1,)))
 
        self.assertEqual(response.status_code, 302)
 

	
 

	
 
class InterfaceUpdateViewTest(PermissionTestMixin, TestCase):
 
class InterfaceUpdateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = InterfaceUpdateView
 
    sufficient_permissions = ("change_interface",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific entity.
 
@@ -919,29 +930,30 @@ class InterfaceUpdateViewTest(Permission
 
                     "netmask": "255.255.255.255"}
 
        request = RequestFactory().post("/fake-path/", data=post_data)
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertEqual(response["Location"], reverse("entity", args=(1,)))
 
        self.assertEqual(response.status_code, 302)
 

	
 

	
 
class InterfaceDeleteViewTest(PermissionTestMixin, TestCase):
 
class InterfaceDeleteViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = InterfaceDeleteView
 
    sufficient_permissions = ("delete_interface",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific interface.
 
@@ -990,25 +1002,25 @@ class InterfaceDeleteViewTest(Permission
 
        # Generate the request
 
        request = RequestFactory().post("/fake-path/")
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 
        request._messages = FakeMessages()
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertEqual(response["Location"], reverse("entity", args=(1,)))
 

	
 

	
 
class CommunicationCreateViewTest(PermissionTestMixin, TestCase):
 
class CommunicationCreateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = CommunicationCreateView
 
    sufficient_permissions = ("add_communication",)
 

	
 
    def setUp(self):
 
        """
 
        Sets-up some data necessary for testing.
 
        """
 

	
 
        # Set-up some data for testing.
 
        project1 = Project.objects.create(name="Test Project 1", description="This is test project 1.")
 
        project2 = Project.objects.create(name="Test Project 2", description="This is test project 2.")
 
@@ -1212,29 +1224,30 @@ class CommunicationCreateViewTest(Permis
 
                     "description": "SSH."}
 
        request = RequestFactory().post("/fake-path", data=post_data)
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 

	
 
        # Get the response.
 
        response = view(request)
 

	
 
        self.assertEqual(response["Location"], reverse("project", args=(1,)))
 
        self.assertEqual(response.status_code, 302)
 

	
 

	
 
class CommunicationUpdateViewTest(PermissionTestMixin, TestCase):
 
class CommunicationUpdateViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = CommunicationUpdateView
 
    sufficient_permissions = ("change_communication",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up.
 
        """
 
@@ -1319,29 +1332,30 @@ class CommunicationUpdateViewTest(Permis
 
                     "port": communication.port}
 
        request = RequestFactory().post("/fake-path/", data=post_data)
 
        request.user = mock.Mock()
 
        request._dont_enforce_csrf_checks = True
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertEqual(response["Location"], reverse("project", args=(communication.source.entity.project.id,)))
 
        self.assertEqual(response.status_code, 302)
 

	
 

	
 
class CommunicationDeleteViewTest(PermissionTestMixin, TestCase):
 
class CommunicationDeleteViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    view_class = CommunicationDeleteView
 
    sufficient_permissions = ("delete_communication",)
 
    permission_test_view_kwargs = {"pk": 1}
 
    render_test_view_kwargs = {"pk": 1}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_context(self):
 
        """
 
        Verifies that the context is properly set-up when the view is called for
 
        specific communication.
 
@@ -1436,24 +1450,25 @@ class CommunicationDeleteViewTest(Permis
 

	
 
        # Get the response.
 
        response = view(request, pk=1)
 

	
 
        self.assertEqual(response["Location"], reverse("entity", args=(communication.source.entity.pk,)))
 

	
 

	
 
class ProjectDiagramTest(PermissionTestMixin, TestCase):
 

	
 
    view_function = staticmethod(project_diagram)
 
    sufficient_permissions = ("view",)
 
    permission_test_view_kwargs = {"pk": "1"}
 
    render_test_view_kwargs = {"pk": "1"}
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_invalid_project(self):
 
        """
 
        Tests if a 404 is returned if no project was found (invalid ID).
 
        """
 
@@ -1531,25 +1546,25 @@ class RedirectToNextMixinTest(TestCase):
 
        """
 

	
 
        # Generate the request.
 
        request = RequestFactory().post("/fake-path?custom=/next")
 

	
 
        # Initialise the pseudo-view.
 
        view = RedirectToNextMixinView(request)
 
        view.next_parameter = "custom"
 

	
 
        self.assertEqual("/next", view.get_success_url())
 

	
 

	
 
class SearchViewTest(PermissionTestMixin, TestCase):
 
class SearchViewTest(RenderTestMixin, PermissionTestMixin, TestCase):
 

	
 
    sufficient_permissions = ("view",)
 
    view_class = SearchView
 

	
 
    def setUp(self):
 
        """
 
        Set-up some test data.
 
        """
 

	
 
        setup_test_data()
 

	
 
    def test_empty_query_error_message(self):
docs/releasenotes.rst
Show inline comments
 
@@ -6,24 +6,33 @@
 
   Unported License. To view a copy of this license, visit
 
   http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
 
   Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
 

	
 

	
 
Release Notes
 
=============
 

	
 

	
 
0.3-maint
 
---------
 

	
 
Bug-fixes:
 

	
 
* Fixed minor issues in the release procedure documentation.
 
  [NO TICKET]
 
* Wrong version of Django Crispy Forms was required by the
 
  package. This resulted in inability to practically use the
 
  application because of exceptions being thrown.
 
  [ `CONNT-32 <https://projects.majic.rs/conntrackt/issues/CONNT-32>`_ ]
 

	
 

	
 
0.3.0
 
-----
 

	
 
Breaking changes:
 

	
 
* Package now has hard dependency on more specific versions of
 
  requirements in order to ensure it is not used with incompatible
 
  variants (for example, Django has been fixated to version
 
  1.5.x). This could cause some issues if application is used with
 
  newer Django versions etc.
 
  [ `CONNT-28 <https://projects.majic.rs/conntrackt/issues/CONNT-28>`_ ]
requirements/base.in
Show inline comments
 
@@ -12,25 +12,25 @@
 
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
# details.
 
#
 
# You should have received a copy of the GNU General Public License along with
 
# Django Conntrackt.  If not, see <http://www.gnu.org/licenses/>.
 
#
 

	
 
# Convenience mixins for Django (for authentication etc).
 
django-braces~=1.12.0
 

	
 
# Convenience tools for controlling rendering of forms while embracing DRY.
 
django-crispy-forms~=1.7.0
 
django-crispy-forms~=1.6.0
 

	
 
# Web framework used by application.
 
django~=1.5.0
 

	
 
# Library for programatic calculation of colours (contrasts,
 
# inversions etc).
 
palette~=0.2.0
 

	
 
# Interaface towards Graphviz for chart generation.
 
pydot~=1.2.0
 

	
 
# Library for data migration in case of model changes.
requirements/development.txt
Show inline comments
 
#
 
# This file is autogenerated by pip-compile
 
# To update, run:
 
#
 
#    pip-compile --output-file ./requirements/development.txt ./requirements/development.in
 
#
 
alabaster==0.7.10         # via sphinx
 
babel==2.5.1              # via sphinx
 
certifi==2017.11.5        # via requests
 
chardet==3.0.4            # via requests
 
coverage==4.4.2
 
django-braces==1.12.0
 
django-crispy-forms==1.7.0
 
django-crispy-forms==1.6.1
 
django-discover-runner==0.3
 
django==1.5.12
 
docutils==0.14            # via sphinx
 
factory-boy==2.1.2
 
funcsigs==1.0.2           # via mock
 
idna==2.6                 # via requests
 
imagesize==0.7.1          # via sphinx
 
jinja2==2.10              # via sphinx
 
markupsafe==1.0           # via jinja2
 
mock==1.3.0
 
palette==0.2
 
pbr==3.1.1                # via mock
requirements/test.txt
Show inline comments
 
#
 
# This file is autogenerated by pip-compile
 
# To update, run:
 
#
 
#    pip-compile --output-file ./requirements/test.txt ./requirements/test.in
 
#
 
alabaster==0.7.10         # via sphinx
 
babel==2.5.1              # via sphinx
 
certifi==2017.11.5        # via requests
 
chardet==3.0.4            # via requests
 
coverage==4.4.2
 
django-braces==1.12.0
 
django-crispy-forms==1.7.0
 
django-crispy-forms==1.6.1
 
django-discover-runner==0.3
 
django==1.5.12
 
docutils==0.14            # via sphinx
 
factory-boy==2.1.2
 
funcsigs==1.0.2           # via mock
 
idna==2.6                 # via requests
 
imagesize==0.7.1          # via sphinx
 
jinja2==2.10              # via sphinx
 
markupsafe==1.0           # via jinja2
 
mock==1.3.0
 
palette==0.2
 
pbr==3.1.1                # via mock
setup.py
Show inline comments
 
@@ -16,25 +16,25 @@
 
#
 
# You should have received a copy of the GNU General Public License along with
 
# Django Conntrackt.  If not, see <http://www.gnu.org/licenses/>.
 
#
 

	
 

	
 
import os
 
from setuptools import setup, find_packages
 

	
 
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
 
INSTALL_REQUIREMENTS = [
 
    "django-braces~=1.12.0",
 
    "django-crispy-forms~=1.7.0",
 
    "django-crispy-forms~=1.6.0",
 
    "django~=1.5.0",
 
    "palette~=0.2.0",
 
    "pydot~=1.2.0",
 
    "south~=1.0.0",
 
]
 

	
 
# allow setup.py to be run from any path
 
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
 

	
 
setup(
 
    name='django-conntrackt',
 
    version='0.3-maint',
0 comments (0 inline, 0 general)