'Natural key requirements are taken into account when serializing models.'

def test_nk_on_serialize(self):

    management.call_command('loaddata', 'forward_ref_lookup.json', verbosity=0)
    out = StringIO()
    management.call_command('dumpdata', 'fixtures_regress.book', 'fixtures_regress.person', 'fixtures_regress.store', verbosity=0, format='json', use_natural_foreign_keys=True, use_natural_primary_keys=True, stdout=out)
    self.assertJSONEqual(out.getvalue(), '\n                                                [{"fields":    {"main":    null,    "name":    "Amazon"},    "model":    "fixtures_regress.store"},\n                                                {"fields":    {"main":    null,    "name":    "Borders"},    "model":    "fixtures_regress.store"},\n                                                {"fields":    {"name":    "Neal    Stephenson"},    "model":    "fixtures_regress.person"},\n                                                {"pk":    1,    "model":    "fixtures_regress.book",    "fields":    {"stores":    [["Amazon"],    ["Borders"]],\n                                                "name":    "Cryptonomicon",    "author":    ["Neal    Stephenson"]}}]\n                                                ')
