예제 #1
0
 def test_open_in_nothing_else(self):
     form = LinkForm({
         'name': 'Linkname',
         'url': 'http://www.nonexistant.test',
         'target': 'artificial'
     })
     self.assertFalse(form.is_valid())
예제 #2
0
    def test_opens_in_same_window_by_default(self):
        """Could not figure out how to render this plugin

        Checking only for the values in the model"""
        form = LinkForm({'name': 'Linkname',
            'url': 'http://www.nonexistant.test'})
        link = form.save()
        self.assertEquals(link.target, '')
예제 #3
0
    def test_opens_in_same_window_by_default(self):
        """Could not figure out how to render this plugin

        Checking only for the values in the model"""
        form = LinkForm({'name': 'Linkname',
            'url': 'http://www.nonexistant.test'})
        link = form.save()
        self.assertEquals(link.target, '')
예제 #4
0
 def test_open_in_top_window(self):
     form = LinkForm({
         'name': 'Linkname',
         'url': 'http://www.nonexistant.test',
         'target': '_top'
     })
     link = form.save()
     self.assertEquals(link.target, '_top')
예제 #5
0
 def test_does_not_verify_existance_of_url(self):
     form = LinkForm(
         {'name': 'Linkname', 'url': 'http://www.nonexistant.test'})
     self.assertEquals(form.is_valid(), True)
예제 #6
0
 def test_open_in_nothing_else(self):
     form = LinkForm({'name': 'Linkname',
         'url': 'http://www.nonexistant.test', 'target' : 'artificial'})
     self.assertFalse(form.is_valid())
예제 #7
0
 def test_open_in_top_window(self):
     form = LinkForm({'name': 'Linkname',
         'url': 'http://www.nonexistant.test', 'target' : '_top'})
     link = form.save()
     self.assertEquals(link.target, '_top')