Exemple #1
0
 def test_dump_widget_data(self):
     widget_data_sets = [
         (
             "national_leadership",
             'test_exports/d_national_leadership.json',
         ),
         (
             'race_rings',
             'test_exports/d_race_rings.json',
         ),
         (
             'rivers',
             'test_exports/d_rivers.json',
         ),
     ]
     for url, fn in widget_data_sets:
         fp = open(fn)
         file_dump = json.load(fp)
         raw_dump = export_widget_data(url)
         json_dump = jsonize(raw_dump)
         cooked_json = json.loads(json_dump)
         self.assertTrue(
             json_equal(file_dump,
                        cooked_json,
                        url,
                        ignore_keys=[
                            "widget_last_updated",
                        ]))
Exemple #2
0
 def test_dump_widget_data(self):
     widget_data_sets = [
         ("national_leadership", 'test_exports/d_national_leadership.json',),
         ('race_rings', 'test_exports/d_race_rings.json',),
         ('rivers', 'test_exports/d_rivers.json',),
     ]
     for url, fn in widget_data_sets:
         fp = open(fn)
         file_dump = json.load(fp)
         raw_dump = export_widget_data(url)
         json_dump = jsonize(raw_dump)
         cooked_json = json.loads(json_dump)
         self.assertTrue(json_equal(file_dump, cooked_json, url, ignore_keys=[ "widget_last_updated", ]))
Exemple #3
0
 def test_dump_widgets(self):
     widgets = [
         ('national_leadership', 'test_exports/w_national_leadership.json', ),
         ('race_rings', 'test_exports/w_race_rings.json',),
         ('rivers', 'test_exports/w_rivers.json',),
     ]
     for url, fn in widgets:
         fp = open(fn)
         file_dump = json.load(fp)
         wf = WidgetFamily.objects.get(url=url)
         raw_dump = wf.export()
         json_dump = jsonize(raw_dump)
         cooked_json = json.loads(json_dump)
         self.assertTrue(json_equal(file_dump, cooked_json, url))
Exemple #4
0
 def test_dump_widgets(self):
     widgets = [
         (
             'national_leadership',
             'test_exports/w_national_leadership.json',
         ),
         (
             'race_rings',
             'test_exports/w_race_rings.json',
         ),
         (
             'rivers',
             'test_exports/w_rivers.json',
         ),
     ]
     for url, fn in widgets:
         fp = open(fn)
         file_dump = json.load(fp)
         wf = WidgetFamily.objects.get(url=url)
         raw_dump = wf.export()
         json_dump = jsonize(raw_dump)
         cooked_json = json.loads(json_dump)
         self.assertTrue(json_equal(file_dump, cooked_json, url))