Skip to content

Commit

Permalink
Merge 8df0a98 into 7a24096
Browse files Browse the repository at this point in the history
  • Loading branch information
radiac committed Oct 23, 2018
2 parents 7a24096 + 8df0a98 commit 0f87c17
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@
(master_doc, 'django-gdpr-assist', 'django-gdpr-assist Documentation',
author, 'django-gdpr-assist', 'One line description of project.',
'Miscellaneous'),
]
]
2 changes: 1 addition & 1 deletion gdpr_assist/admin/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def handle_export(self, request, querysets):
csv_writer.writerow(obj_export)

# Add CSV file to zip
privacy_meta = getattr(
privacy_meta = getattr(
model,
app_settings.GDPR_PRIVACY_INSTANCE_NAME,
)
Expand Down
2 changes: 0 additions & 2 deletions gdpr_assist/management/commands/anonymise_db.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""
Anonymise all personal data in the database
"""
import six

from django.core.management import BaseCommand

from ... import app_settings
Expand Down
4 changes: 2 additions & 2 deletions gdpr_assist/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def deconstruct(self):
"""
# Check bases are as expected from _cast_class
bases = self.__class__.__bases__
if len(bases) != 2:
if len(bases) != 2: # pragma: no cover
raise ValueError('Unexpected base classes for CastPrivacyManager')

# Original is second - instatiate and deconstruct it
Expand Down Expand Up @@ -283,7 +283,7 @@ class EventLog(models.Model):
model_name = models.CharField(max_length=255)
target_pk = models.TextField()

objects = EventLogManager() #.db_manager(app_settings.GDPR_LOG_DATABASE_NAME)
objects = EventLogManager()

def get_target(self):
model = apps.get_model(self.app_label, self.model_name)
Expand Down
11 changes: 4 additions & 7 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
from io import BytesIO, TextIOWrapper
import csv
import six
import sys
import zipfile

import django
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.test import Client, TestCase
Expand All @@ -17,7 +15,6 @@

import gdpr_assist

from .gdpr_assist_tests_app.admin import ModelWithPrivacyMetaAdmin
from .gdpr_assist_tests_app.models import (
ModelWithPrivacyMeta,
FirstSearchModel,
Expand Down Expand Up @@ -48,7 +45,7 @@ def setUp(self):

class TestModelAdmin(AdminTestCase):
def test_changelist__anonymise_action_present(self):
obj = mommy.make(ModelWithPrivacyMeta)
mommy.make(ModelWithPrivacyMeta)
response = self.client.get(model_root_url)
self.assertContains(response, '<option value="anonymise">')

Expand Down Expand Up @@ -126,13 +123,13 @@ def test_anonymise_view_submit__redirect_to_anonymise_view(self):

self.assertContains(
response,
'<li class="success">2 Model With Privacy Metas anonymised</li>',
'<li class="success">2 Model With Privacy Metas anonymised</li>',
)


class TestAdminTool(AdminTestCase):
def test_tool_is_available(self):
obj = mommy.make(FirstSearchModel)
mommy.make(FirstSearchModel)
response = self.client.get(tool_root_url)
self.assertContains(response, '<h1>Personal Data</h1>')

Expand All @@ -141,7 +138,7 @@ def test_search__returns_correct_results(self):
FirstSearchModel,
email='one@example.com',
)
obj_2 = mommy.make(
mommy.make(
FirstSearchModel,
email='two@example.com',
)
Expand Down
1 change: 0 additions & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def test_anonymise_disabled__raises_error(self):
)



class TestRerunCommand(CommandTestCase):
def test_gdpr_delete__deletes_object(self):
obj_1 = ModelWithPrivacyMeta.objects.create(
Expand Down

0 comments on commit 0f87c17

Please sign in to comment.