コード例 #1
0
ファイル: test_models.py プロジェクト: cenh/ProjectStockSD
    def test_create_no_attributes(self):
        """Try and create a project without setting any attributes

        This should fail with ValidationError
        """
        project = Project()
        with self.assertRaises(ValidationError):
            project.full_clean()
コード例 #2
0
    def test_create_no_attributes(self):
        """Try and create a project without setting any attributes

        This should fail with ValidationError
        """
        project = Project()
        with self.assertRaises(ValidationError):
            project.full_clean()
コード例 #3
0
 def test_valid_website(self):
     project = Project()
     project.name = 'Test project'
     project.type = 'O'
     for u in valid_urls:
         project.website = u
         project.full_clean()
コード例 #4
0
 def test_invalid_website(self):
     project = Project()
     project.name = 'Test project'
     project.type = 'O'
     for u in invalid_urls:
         project.website = u
         with self.assertRaises(ValidationError):
             project.full_clean()
コード例 #5
0
ファイル: test_models.py プロジェクト: cenh/ProjectStockSD
 def test_valid_website(self):
     project = Project()
     project.name = 'Test project'
     project.type = 'O'
     for u in valid_urls:
         project.website = u
         project.full_clean()
コード例 #6
0
ファイル: test_models.py プロジェクト: cenh/ProjectStockSD
 def test_invalid_website(self):
     project = Project()
     project.name = 'Test project'
     project.type = 'O'
     for u in invalid_urls:
         project.website = u
         with self.assertRaises(ValidationError):
             project.full_clean()
コード例 #7
0
ファイル: test_models.py プロジェクト: cenh/ProjectStockSD
 def test_create_necessary_attributes(self):
     project = Project()
     project.name = 'Test project'
     project.type = 'O'
     project.full_clean()
コード例 #8
0
 def test_create_necessary_attributes(self):
     project = Project()
     project.name = 'Test project'
     project.type = 'O'
     project.full_clean()