Пример #1
0
 def test_save(self):
     rs = ReportStorage()
     rs.dirPath = self.tempdir
     rs.default = True
     rs.name = 'HomeTest'
     rs.webServerPath = '/outputTest'
     rs.save()
     self.assertIsNotNone(rs.id, 'ReportStorage id is None')
     return rs
Пример #2
0
 def setUp(self):
     self.tempdir = tempfile.mkdtemp()
     rs = ReportStorage()
     rs.dirPath = self.tempdir
     rs.default = True
     rs.name = 'HomeTest'
     rs.webServerPath = '/outputTest'
     rs.save()
     self.reportstorage = rs
Пример #3
0
 def setUp(self):
     self.tempdir = tempfile.mkdtemp()
     rs = ReportStorage()
     rs.dirPath = self.tempdir
     rs.default = True
     rs.name = 'HomeTest'
     rs.webServerPath = '/outputTest'
     rs.save()
     self.reportstorage = rs
Пример #4
0
 def test_save(self):
     rs = ReportStorage()
     rs.dirPath = self.tempdir
     rs.default = True
     rs.name = 'HomeTest'
     rs.webServerPath = '/outputTest'
     rs.save()
     self.assertIsNotNone(rs.id, 'ReportStorage id is None')
     return rs
Пример #5
0
    def test_save_method(self):
        rs = ReportStorage()
        rs.dirPath = self.tempdir
        rs.default = True
        rs.name = 'HomeTest'
        rs.webServerPath = '/outputTest'
        rs.save()

        rs = ReportStorage()
        rs.dirPath = self.tempdir2
        rs.default = True
        rs.name = 'HomeTest'
        rs.webServerPath = '/outputTest'
        rs.save()

        for rs in ReportStorage.objects.exclude(id=rs.id):
            self.assertFalse(
                rs.default,
                'Should not be default report storage location, only one default location is allowed'
            )
Пример #6
0
    def test_save_method(self):
        rs = ReportStorage()
        rs.dirPath = self.tempdir
        rs.default = True
        rs.name = 'HomeTest'
        rs.webServerPath = '/outputTest'
        rs.save()

        rs = ReportStorage()
        rs.dirPath = self.tempdir2
        rs.default = True
        rs.name = 'HomeTest'
        rs.webServerPath = '/outputTest'
        rs.save()

        for rs in ReportStorage.objects.exclude(id=rs.id):
            self.assertFalse(rs.default, 'Should not be default report storage location, only one default location is allowed')