a TestCase subclass to help you test your abstract django models
1- subclass your django abstract models
| class PartialIndex(Index): | |
| def __init__(self, fields=[], name=None, condition=None, unique=False): | |
| # TODO accept condition as dictionary and make sql escaping and quoting | |
| self.condition = condition | |
| self.unique = unique | |
| super(PartialIndex, self).__init__(fields=fields, name=name) | |
| def deconstruct(self): | |
| path, args, kwargs = super(PartialIndex, self).deconstruct() | |
| kwargs['unique'] = self.unique |
| { | |
| "AWSTemplateFormatVersion": "2010-09-09", | |
| "Conditions": { | |
| "EFSEncrypted": { | |
| "Fn::Equals": [ | |
| { | |
| "Ref": "EncryptEFS" | |
| }, | |
| "true" | |
| ] |