Ejemplo n.º 1
0
 def test_udk_is_valid(self):
     artextra_form = ArtExtraForm(instance=self.artextra)
     self.assertFalse(artextra_form.is_valid()) # pages assumed to be mandatory
     bound_artextra_form = ArtExtraForm({'doi':'', 'udk':'518', 'pages':'1-2'}, instance=self.artextra)
     self.assertTrue(bound_artextra_form.is_valid())
     bound_artextra_form = ArtExtraForm({'doi':'', 'udk':'buba', 'pages':'1-2'}, instance=self.artextra)
     self.assertFalse(bound_artextra_form.is_valid())
Ejemplo n.º 2
0
 def test_doi_is_valid(self):
     artextra_form = ArtExtraForm(instance=self.artextra)
     self.assertFalse(artextra_form.is_valid()) # pages assumed to be mandatory
     bound_artextra_form = ArtExtraForm({'doi':'10.17581/bp.2016.05102', 'udk':'', 'pages':'1-2'}, instance=self.artextra)
     self.assertTrue(bound_artextra_form.is_valid())
     bound_artextra_form = ArtExtraForm({'doi':'//df//sdf', 'udk':'', 'pages':'1-2'}, instance=self.artextra)
     self.assertFalse(bound_artextra_form.is_valid())