equal
deleted
inserted
replaced
50 |
50 |
51 class RepositoryTC(CubicWebTC): |
51 class RepositoryTC(CubicWebTC): |
52 """ singleton providing access to a persistent storage for entities |
52 """ singleton providing access to a persistent storage for entities |
53 and relation |
53 and relation |
54 """ |
54 """ |
|
55 |
|
56 def test_uniquetogether(self): |
|
57 self.execute('INSERT Societe S: S nom "Logilab", S type "SSLL", S cp "75013"') |
|
58 with self.assertRaises(ValidationError) as wraperr: |
|
59 self.execute('INSERT Societe S: S nom "Logilab", S type "SSLL", S cp "75013"') |
|
60 self.assertEqual({'nom': u'violates unique_together constraints (cp, nom, type)', |
|
61 'cp': u'violates unique_together constraints (cp, nom, type)', |
|
62 'type': u'violates unique_together constraints (cp, nom, type)'}, |
|
63 wraperr.exception.args[1]) |
55 |
64 |
56 def test_fill_schema(self): |
65 def test_fill_schema(self): |
57 origshema = self.repo.schema |
66 origshema = self.repo.schema |
58 try: |
67 try: |
59 self.repo.schema = CubicWebSchema(self.repo.config.appid) |
68 self.repo.schema = CubicWebSchema(self.repo.config.appid) |