Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
0.1.4 release. Fixes tests and model logic.
- Fixes counters: always enabled (would break migrations) - Adds `add_log_user()` and `add_reference()` helper methods - Bumps coverage to 100% - Improved README
- Loading branch information
achedeuzot
committed
Nov 25, 2016
1 parent
86a4bac
commit eaf7a7b
Showing
11 changed files
with
213 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
__version__ = '0.1.3' | ||
__version__ = '0.1.4' | ||
|
||
default_app_config = 'django_commandlog.apps.CommandLogConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals, print_function | ||
|
||
|
||
import datetime | ||
from django.contrib.admin import AdminSite | ||
from django.test import TestCase | ||
from django.utils.timezone import make_aware | ||
|
||
from django_commandlog.admin import CommandLogAdmin | ||
from django_commandlog.models import CommandLog | ||
|
||
|
||
class MockRequest(object): | ||
pass | ||
|
||
|
||
class MockSuperUser(object): | ||
def has_perm(self, perm): | ||
return True | ||
|
||
|
||
request = MockRequest() | ||
request.user = MockSuperUser() | ||
|
||
|
||
class CommandLogAdminTestCase(TestCase): | ||
|
||
def setUp(self): | ||
self.site = AdminSite() | ||
self.cmdlog = CommandLog() | ||
self.cmdlog.save() | ||
self.cmdlog.start_at = make_aware(datetime.datetime(year=2016, month=2, day=2, hour=13, minute=37, second=42)) | ||
self.cmdlog.end_at = self.cmdlog.start_at + datetime.timedelta(days=1) | ||
self.cmdlog.created = 42 | ||
self.cmdlog.deleted = 21 | ||
self.cmdlog.save() | ||
|
||
def test_log_admin_duration(self): | ||
self.assertEqual(CommandLogAdmin.duration(self.cmdlog), datetime.timedelta(days=1)) | ||
|
||
def test_log_admin_total_crud(self): | ||
self.assertEqual(CommandLogAdmin.total_crud(self.cmdlog), 63) |
Oops, something went wrong.