29 class CWPropertyHooksTC(CubicWebTC): |
29 class CWPropertyHooksTC(CubicWebTC): |
30 |
30 |
31 def test_unexistant_cwproperty(self): |
31 def test_unexistant_cwproperty(self): |
32 with self.assertRaises(ValidationError) as cm: |
32 with self.assertRaises(ValidationError) as cm: |
33 self.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop", X for_user U') |
33 self.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop", X for_user U') |
|
34 cm.exception.tr(unicode) |
34 self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) |
35 self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) |
35 with self.assertRaises(ValidationError) as cm: |
36 with self.assertRaises(ValidationError) as cm: |
36 self.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop"') |
37 self.execute('INSERT CWProperty X: X pkey "bla.bla", X value "hop"') |
|
38 cm.exception.tr(unicode) |
37 self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) |
39 self.assertEqual(cm.exception.errors, {'pkey-subject': 'unknown property key bla.bla'}) |
38 |
40 |
39 def test_site_wide_cwproperty(self): |
41 def test_site_wide_cwproperty(self): |
40 with self.assertRaises(ValidationError) as cm: |
42 with self.assertRaises(ValidationError) as cm: |
41 self.execute('INSERT CWProperty X: X pkey "ui.site-title", X value "hop", X for_user U') |
43 self.execute('INSERT CWProperty X: X pkey "ui.site-title", X value "hop", X for_user U') |