Commits

Gor...@Gordon-PC.hsd1.ga.comcast.net.  committed 3ca76ba

test OneToOneField too

  • Participants
  • Parent commits 42b7c9e

Comments (0)

Files changed (1)

File simple_history/tests.py

 Test Models
 ~~~~~~~~~~~~~~~~~~~~~~~
 """
-from django.db.models import Model, CharField, ForeignKey
+from django.db.models import Model, CharField, ForeignKey, OneToOneField
 from django.db.models.base import ModelBase
 from models import HistoricalRecords
 
 class B(TestModel):
     a = ForeignKey(A)
 
+class C(TestModel):
+    a = OneToOneField(A)
+
 """
 ~~~~~~~~~~~~~~~~~~~~~~~
 Test Case
         b = B()
         b.pk = "hijklm5678"
         b.a = a
-        b.save()
+        b.save()
+        
+    def test_alphanumeric_o2o(self):
+        a = A()
+        a.pk = "abcdef1234"
+        a.save()
+        
+        c = C()
+        c.pk = "hijklm5678"
+        c.a = a
+        c.save()