We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71a6190 commit 541abb1Copy full SHA for 541abb1
tests/table/test_meta.py
tests/table/test_metaclass.py
@@ -1,9 +1,25 @@
1
from unittest import TestCase
2
3
+from piccolo.table import Table
4
+
5
from ..example_app.tables import Band
6
7
8
class TestMetaClass(TestCase):
9
def test_tablename(self):
10
self.assertEqual(Band._meta.tablename, "band")
11
12
+ def test_protected_table_names(self):
13
+ """
14
+ Some tablenames are forbidden because they're reserved words in the
15
+ database, and can potentially cause issues.
16
17
+ with self.assertRaises(ValueError):
18
19
+ class User(Table):
20
+ pass
21
22
23
24
+ class MyUser(Table, tablename="user"):
25
0 commit comments