Skip to content

Commit

Permalink
Revert feature regressions for 1.7
Browse files Browse the repository at this point in the history
@aaugustin 1.7 bugs should be apparent now
  • Loading branch information
treyhunner committed Apr 14, 2014
1 parent de3eda6 commit 28ed134
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 2 additions & 7 deletions simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def create_history_model(self, model):
if model.__module__ != self.module:
# registered under different app
attrs['__module__'] = self.module
elif django_version < (1, 7, 0) and app_module != self.module:
elif app_module != self.module:
# has meta options with app_label
app = models.get_app(model._meta.app_label) # FIXME This is broken in 1.7
attrs['__module__'] = app.__name__ # full dotted name
Expand Down Expand Up @@ -173,12 +173,7 @@ def get_meta_options(self, model):
if self.user_set_verbose_name:
name = self.user_set_verbose_name
else:
try:
name = 'historical ' + text_type(model._meta.verbose_name)
except RuntimeError:
# Django 1.7 app registry makes this impossible
from django.utils.text import camel_case_to_spaces
name = camel_case_to_spaces(model.__name__)
name = 'historical ' + text_type(model._meta.verbose_name)
meta_fields['verbose_name'] = name
return meta_fields

Expand Down
5 changes: 0 additions & 5 deletions simple_history/tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
from __future__ import unicode_literals
try:
from unittest import skipUnless
except ImportError: # Python 2.6
from django.utils.unittest import skipUnless

from datetime import datetime, timedelta
from django import VERSION
Expand Down Expand Up @@ -313,7 +309,6 @@ class AppLabelTest(TestCase):
def get_table_name(self, manager):
return manager.model._meta.db_table

@skipUnless(VERSION < (1, 7, 0), "this feature is broken in 1.7")
def test_explicit_app_label(self):
self.assertEqual(self.get_table_name(ExternalModel1.objects),
'external_externalmodel1')
Expand Down

0 comments on commit 28ed134

Please sign in to comment.