Example #1
0
    def test_create_no_attributes(self):
        """Try and create a supervisor without setting any attributes

        This should fail with ValidationError
        """
        supervisor = Supervisor()
        with self.assertRaises(ValidationError):
            supervisor.full_clean()
Example #2
0
    def test_create_no_attributes(self):
        """Try and create a supervisor without setting any attributes

        This should fail with ValidationError
        """
        supervisor = Supervisor()
        with self.assertRaises(ValidationError):
            supervisor.full_clean()
Example #3
0
    def test_valid_websites(self):
        """Try and submit supervisor with various valid website URLs

        This should pass
        """
        supervisor = Supervisor()
        supervisor.first_name = 'Arthur'
        supervisor.last_name = 'Anderson'
        supervisor.email = '*****@*****.**'
        for u in valid_urls:
            supervisor.website = u
            supervisor.full_clean()
Example #4
0
    def test_invalid_websites(self):
        """Try and submit supervisor with an invalid website URL

        This should fail with ValidationError
        """
        supervisor = Supervisor()
        supervisor.first_name = 'Arthur'
        supervisor.last_name = 'Anderson'
        supervisor.email = '*****@*****.**'
        for u in invalid_urls:
            supervisor.website = u
            with self.assertRaises(ValidationError):
                supervisor.full_clean()
Example #5
0
    def test_create_necessary_attributes(self):
        """Try and create a supervisor with the necessary attributes

        This should pass
        """
        supervisor = Supervisor()
        supervisor.first_name = 'Arthur'
        supervisor.last_name = 'Anderson'
        supervisor.email = '*****@*****.**'
        supervisor.full_clean()
Example #6
0
    def test_valid_websites(self):
        """Try and submit supervisor with various valid website URLs

        This should pass
        """
        supervisor = Supervisor()
        supervisor.first_name = 'Arthur'
        supervisor.last_name = 'Anderson'
        supervisor.email = '*****@*****.**'
        for u in valid_urls:
            supervisor.website = u
            supervisor.full_clean()
Example #7
0
    def test_invalid_websites(self):
        """Try and submit supervisor with an invalid website URL

        This should fail with ValidationError
        """
        supervisor = Supervisor()
        supervisor.first_name = 'Arthur'
        supervisor.last_name = 'Anderson'
        supervisor.email = '*****@*****.**'
        for u in invalid_urls:
            supervisor.website = u
            with self.assertRaises(ValidationError):
                supervisor.full_clean()
Example #8
0
    def test_create_necessary_attributes(self):
        """Try and create a supervisor with the necessary attributes

        This should pass
        """
        supervisor = Supervisor()
        supervisor.first_name = 'Arthur'
        supervisor.last_name = 'Anderson'
        supervisor.email = '*****@*****.**'
        supervisor.full_clean()