from django.db import models
from django.test import TestCase

from dfk import repoint

class ModelA(models.Model):
    pass
    
class ModelB(models.Model):
    fk = models.ForeignKey(ModelA)
    
class ModelC(models.Model):
    pass
    
class NotAModel(object):
    pass
    
class AbstractModel(models.Model):
    class Meta:
        abstract = True
    
repoint(ModelB, 'fk', ModelC)
    
class ExistingTestCase(TestCase):
    
    def test_existing_fk(self):
        c = ModelC.objects.create()
        b = ModelB.objects.create(fk=c)
        b.save()
        
        x = ModelB.objects.get(pk=b.pk)
        self.assertEqual(c, b.fk)
        
    def test_not_a_model(self):
        self.assertRaises(AssertionError, repoint, ModelB, 'fk', NotAModel)

    def test_abstract(self):
        self.assertRaises(AssertionError, repoint, ModelB, 'fk', AbstractModel)
@@ -450,32 +450,173 @@
 sting_fk(self):%0A
+        # We've repointed ModelB's 'fk' field to reference%0A        # ModelC, rather than ModelA. Check this has worked%0A        # as expected%0A
         c = Mode

Add explanatory comment to tests