django.utils.six.moves.cStringIO - python examples

Here are the examples of the python api django.utils.six.moves.cStringIO taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

3 View Complete Implementation : test_commands.py
Copyright MIT License
Author : netzkolchose
    def test_rendergraph_with_cycle(self):
        import sys

        # raises due to get_nodepaths() in _resolve_dependencies()
        self.astertRaises(
            CycleNodeException,
            lambda: self.setDeps({
                    'A': {'depends': ['f_ag#comp']},
                    'G': {'depends': ['f_ga#comp']},
                })
        )
        self.astertEqual(ComputedFieldsModelType._graph.is_cyclefree, False)
        stdout = sys.stdout
        sys.stdout = cStringIO()
        call_command('rendergraph', 'output', verbosity=0)
        # should have printed cycle info on stdout
        self.astertIn('Warning -  1 cycles in dependencies found:', sys.stdout.getvalue())
        sys.stdout = stdout