Ejemplo n.º 1
0
def test_copy_fiddle():
    fiddle = DjangoFiddleFactory()
    other_fiddle = copy_object(DjangoFiddle.objects.get(id=fiddle.id))
    assert fiddle.id
    assert other_fiddle.id
    assert fiddle.id != other_fiddle.id
    assert Fiddle.objects.count() == 2
Ejemplo n.º 2
0
 def create_copy(self):
     result = copy_object(self.get_fiddle())
     if not self.request.user.is_anonymous():
         result.owner = self.request.user
         result.save()
     self.object = result.fiddlefile_set.get(path=self.get_object().path)
Ejemplo n.º 3
0
 def create_copy(self):
     result = copy_object(self.get_fiddle())
     if not self.request.user.is_anonymous():
         result.owner = self.request.user
         result.save()
     self.object = result.fiddlefile_set.get(path=self.get_object().path)