コード例 #1
0
ファイル: tests.py プロジェクト: klpdotorg/KLP-MIS
 def test_inheritence(self):
     fullhistory.end_session()
     t4 = Test4Model(field1='test1', field2=-1)
     t4.save()
     for history in fullhistory.get_active_histories():
         if 'field1' in history.data:
             break
     else:
         self.fail('Did not find field1 in history')
     t4.field1 = 'test1a'
     t4.save()
     t4 = Test4Model.objects.get(pk=t4.pk)
     t4.field2 = 0
     t4.save()
     t2 = Test2Model.objects.get(pk=t4.pk)
     t2.field1 = 'test1b'
     t2.save()
     t4.delete()
コード例 #2
0
 def test_inheritence(self):
     fullhistory.end_session()
     t4 = Test4Model(field1="test1", field2=-1)
     t4.save()
     for history in fullhistory.get_active_histories():
         if 'field1' in history.data:
             break
     else:
         self.fail("Did not find field1 in history")
     t4.field1 = "test1a"
     t4.save()
     t4 = Test4Model.objects.get(pk=t4.pk)
     t4.field2 = 0
     t4.save()
     t2 = Test2Model.objects.get(pk=t4.pk)
     t2.field1 = "test1b"
     t2.save()
     t4.delete()
コード例 #3
0
 def update_history(self):
     try:
         self.history = (self.ticket.history.all()
                         & fullhistory.get_active_histories()).latest()
     except FullHistory.DoesNotExist:
         pass
コード例 #4
0
 def update_history(self):
     try:
         self.history = (self.ticket.history.all() & fullhistory.get_active_histories()).latest()
     except FullHistory.DoesNotExist:
         pass