def test_fk_reflection(self):
    regex = self.parser._re_fk_constraint
    m = regex.match('  CONSTRAINT `addresses_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE')
    eq_(m.groups(), ('addresses_user_id_fkey', '`user_id`', '`users`', '`id`', None, 'CASCADE', 'CASCADE'))
    m = regex.match('  CONSTRAINT `addresses_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE SET NULL')
    eq_(m.groups(), ('addresses_user_id_fkey', '`user_id`', '`users`', '`id`', None, 'CASCADE', 'SET NULL'))
def test_fk_reflection(self):
    regex = self.parser._re_fk_constraint
    m = regex.match('  CONSTRAINT `addresses_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE')
    eq_(m.groups(), ('addresses_user_id_fkey', '`user_id`', '`users`', '`id`', None, 'CASCADE', 'CASCADE'))
    m = regex.match('  CONSTRAINT `addresses_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE SET NULL')
    eq_(m.groups(), ('addresses_user_id_fkey', '`user_id`', '`users`', '`id`', None, 'CASCADE', 'SET NULL'))