def test_copying_inside_many_to_many(self):
     instance = G(ModelWithRelationships,
                  manytomany=[F(integer=C('integer_b'))])
     instance1 = instance.manytomany.all()[0]
     self.assertEquals(instance1.integer, instance1.integer_b)
 def test_copying_from_a_self_fk(self):
     instance = G(ModelWithRelationships,
                  integer=C('selfforeignkey.integer_b'))
     self.assertEquals(instance.integer, instance.selfforeignkey.integer_b)
 def test_copying_inside_fk(self):
     instance = G(ModelWithRelationships,
                  selfforeignkey=F(integer=C('selfforeignkey.integer_b')))
     self.assertEquals(instance.selfforeignkey.integer,
                       instance.selfforeignkey.selfforeignkey.integer_b)
 def test_copying_from_a_one2one(self):
     instance = G(ModelWithRelationships, integer=C('onetoone.integer'))
     self.assertEquals(instance.integer, instance.onetoone.integer)
 def test_copying_from_the_same_model(self):
     instance = G(ModelWithRelationships, integer=C('integer_b'))
     self.assertEquals(instance.integer, instance.integer_b)
Example #6
0
 def test_copying_inside_fk(self):
     instance = G(ModelWithRelationships,
                  selfforeignkey=F(selfforeignkey=F(),
                                   integer=C('selfforeignkey.integer_b')))
     assert instance.selfforeignkey.integer == instance.selfforeignkey.selfforeignkey.integer_b
Example #7
0
 def test_copying_from_a_one2one(self):
     instance = G(ModelWithRelationships,
                  onetoone=F(),
                  integer=C('onetoone.integer'))
     assert instance.integer == instance.onetoone.integer
Example #8
0
 def test_copying_from_a_fk(self):
     instance = G(ModelWithRelationships,
                  foreignkey=F(),
                  integer=C('foreignkey.integer'))
     assert instance.integer == instance.foreignkey.integer