diff --git a/conftest.py b/conftest.py index 8a50790..128b9ae 100644 --- a/conftest.py +++ b/conftest.py @@ -10,7 +10,10 @@ from guardian.shortcuts import assign_perm @pytest.fixture(scope='session') def django_db_setup(django_db_setup, django_db_blocker): with django_db_blocker.unblock(): + call_command('loaddata', 'core.yaml') + call_command('loaddata', 'devices.yaml') call_command('loaddata', 'inventory.yaml') + call_command('loaddata', 'nets.yaml') @pytest.fixture @@ -19,7 +22,7 @@ def create_admin_user(): User = get_user_model() admin = User.objects.create_user("novartis-admin", "admin@novartis.com", "password", is_staff=True) - customer = mixer.blend('customer.Customer') + customer = mixer.blend('customers.Customer') group = Group.objects.create(name="Novartis Admin") admin.groups.add(group) assign_perm('view_customer', admin, customer) diff --git a/inventory/templates/inventory/base.html b/core/templates/core/base.html similarity index 100% rename from inventory/templates/inventory/base.html rename to core/templates/core/base.html diff --git a/inventory/templates/registration/login.html b/core/templates/registration/login.html similarity index 100% rename from inventory/templates/registration/login.html rename to core/templates/registration/login.html diff --git a/customers/decorators.py b/customers/decorators.py index ad2add4..875b964 100644 --- a/customers/decorators.py +++ b/customers/decorators.py @@ -7,7 +7,7 @@ def customer_view_permission(old_function): def new_function(request, pk, *args, **kwargs): customer = Customer.objects.get(pk=pk) user = request.user - if user.has_perm('customer.view_customer', customer): + if user.has_perm('customers.view_customer', customer): return old_function(request, pk) else: return HttpResponseForbidden( diff --git a/inventory/templates/inventory/all_computers.html b/customers/templates/inventory/all_computers.html similarity index 100% rename from inventory/templates/inventory/all_computers.html rename to customers/templates/inventory/all_computers.html diff --git a/inventory/templates/inventory/backup_details.html b/customers/templates/inventory/backup_details.html similarity index 100% rename from inventory/templates/inventory/backup_details.html rename to customers/templates/inventory/backup_details.html diff --git a/inventory/templates/inventory/backup_list.html b/customers/templates/inventory/backup_list.html similarity index 100% rename from inventory/templates/inventory/backup_list.html rename to customers/templates/inventory/backup_list.html diff --git a/customers/templates/inventory/base.html b/customers/templates/inventory/base.html new file mode 100644 index 0000000..2517d3f --- /dev/null +++ b/customers/templates/inventory/base.html @@ -0,0 +1,28 @@ +{% load static %} + +
+ +