Beispiel #1
0
 def create_revisions(self, num, document, creator):
     """Create as many revisions as requested, and return a list of them."""
     revisions_created = []
     for i in range(1, 1 + num):
         new_revision = create_revision(title='Revision {}'.format(i),
                                        document=document,
                                        creator=creator,
                                        save=True)
         revisions_created.append(new_revision)
     return revisions_created
Beispiel #2
0
 def create_revisions(self, num, document, creator):
     """Create as many revisions as requested, and return a list of them."""
     revisions_created = []
     for i in range(1, 1 + num):
         new_revision = create_revision(
             title='Revision {}'.format(i),
             document=document,
             creator=creator,
             save=True)
         revisions_created.append(new_revision)
     return revisions_created
Beispiel #3
0
    def setUp(self):
        super(SampleRevisionsMixin, self).setUp()

        # Some users to use in the tests
        self.testuser = self.user_model.objects.get(username='******')
        self.testuser2 = self.user_model.objects.get(username='******')
        self.admin = self.user_model.objects.get(username='******')

        # Create an original revision on a document by the admin user
        self.document = create_document(save=True)
        self.original_revision = create_revision(title='Revision 0',
                                                 document=self.document,
                                                 creator=self.admin,
                                                 save=True)
Beispiel #4
0
 def create_revisions(self, num, creator, document=None):
     """Create as many revisions as requested, and return a list of them."""
     # If document is None, then we create a new document for each revision
     create_new_documents = not document
     revisions_created = []
     for i in range(1, 1 + num):
         if create_new_documents is True:
             document = create_document(save=True)
         new_revision = create_revision(
             title='Doc id {} Revision {}'.format(document.id, i),
             document=document,
             creator=creator,
             save=True)
         revisions_created.append(new_revision)
     return revisions_created
Beispiel #5
0
    def setUp(self):
        super(SampleRevisionsMixin, self).setUp()

        # Some users to use in the tests
        self.testuser = self.user_model.objects.get(username='******')
        self.testuser2 = self.user_model.objects.get(username='******')
        self.admin = self.user_model.objects.get(username='******')

        # Create an original revision on a document by the admin user
        self.document = create_document(save=True)
        self.original_revision = create_revision(
            title='Revision 0',
            document=self.document,
            creator=self.admin,
            save=True)
Beispiel #6
0
 def create_revisions(self, num, creator, document=None):
     """Create as many revisions as requested, and return a list of them."""
     # If document is None, then we create a new document for each revision
     create_new_documents = not document
     revisions_created = []
     for i in range(1, 1 + num):
         if create_new_documents is True:
             document = create_document(save=True)
         new_revision = create_revision(
             title='Doc id {} Revision {}'.format(document.id, i),
             document=document,
             creator=creator,
             save=True)
         revisions_created.append(new_revision)
     return revisions_created