예제 #1
0
파일: accounts.py 프로젝트: dcuolfg/dcuolfg
    def test_profile_web_validation(self):
        """Profile.web should be a real URL.

        Even partial URLs are not allowed.
        """
        profile = Profile()
        profile.web = 'foobar.com'
        with self.assertRaises(ValidationError) as err:
            profile.full_clean()
        expected_message = 'Enter a valid value.'
        message_list = err.exception.message_dict.get('web')
        self.assertEqual(expected_message, message_list[0])
예제 #2
0
파일: accounts.py 프로젝트: dcuolfg/dcuolfg
 def test_profile_update_web(self):
     """You should be able to update web for a Profile."""
     profile = Profile()
     profile.web = 'http://example.com/'
     self.assertEqual('http://example.com/', profile.web)