Skip to content

Commit

Permalink
Update create history model test to use register() instead of the i…
Browse files Browse the repository at this point in the history
…nternal API
  • Loading branch information
macro1 committed Apr 3, 2015
1 parent 7e97aec commit ae20ef4
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions simple_history/tests/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,29 +327,23 @@ def test_register_custome_records(self):
class CreateHistoryModelTests(TestCase):

def test_create_history_model_with_one_to_one_field_to_integer_field(self):
records = HistoricalRecords()
records.module = AdminProfile.__module__
try:
records.create_history_model(AdminProfile)
except:
register(AdminProfile)
except Exception:
self.fail("SimpleHistory should handle foreign keys to one to one"
"fields to integer fields without throwing an exception")

def test_create_history_model_with_one_to_one_field_to_char_field(self):
records = HistoricalRecords()
records.module = Bookcase.__module__
try:
records.create_history_model(Bookcase)
except:
register(Bookcase)
except Exception:
self.fail("SimpleHistory should handle foreign keys to one to one"
"fields to char fields without throwing an exception.")

def test_create_history_model_with_multiple_one_to_ones(self):
records = HistoricalRecords()
records.module = MultiOneToOne.__module__
try:
records.create_history_model(MultiOneToOne)
except:
register(MultiOneToOne)
except Exception:
self.fail("SimpleHistory should handle foreign keys to one to one"
"fields to one to one fields without throwing an "
"exception.")
Expand Down

0 comments on commit ae20ef4

Please sign in to comment.