I have a list of dicts defined in setUpClass
in a Django TestCase
:
class MyTest(TestCase):
@classmethod
def setUpClass(cls):
myobj = MyModel.objects.create()
cls.MY_LIST = [
({ 'key1': {'a': myobj.id, 'b': 2}},),
({ 'key2': {'a': myobj.id, 'b': 2}},),
]
How do I reference MY_LIST
using parameterized? E.g.
@parameterized.expand(MyTest().setUpClass().MYLIST):
def test_mytest(self, dict_item):
print(dict_item.items())
Results in AttributeError: 'NoneType' object has no attribute 'MYLIST'
.