[damned-lies] Fix fixture creation
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Fix fixture creation
- Date: Wed, 23 Mar 2011 12:58:55 +0000 (UTC)
commit 6fd38e7d41d953049efd527f022b3a1acd0969a0
Author: Claude Paroz <claude 2xlibre net>
Date: Wed Mar 23 13:52:45 2011 +0100
Fix fixture creation
stats/fixtures/sample_data.json | 616 +++++++++++++++++++++++++++++----------
stats/tests/fixture_factory.py | 2 +-
2 files changed, 459 insertions(+), 159 deletions(-)
---
diff --git a/stats/fixtures/sample_data.json b/stats/fixtures/sample_data.json
index 05d3886..8e85b00 100644
--- a/stats/fixtures/sample_data.json
+++ b/stats/fixtures/sample_data.json
@@ -97,36 +97,6 @@
},
{
"pk": 1,
- "model": "languages.language",
- "fields": {
- "locale": "en",
- "plurals": "nplurals=2; plural=(n != 1)",
- "name": "en",
- "team": null
- }
- },
- {
- "pk": 2,
- "model": "languages.language",
- "fields": {
- "locale": "fr",
- "plurals": "nplurals=2; plural=(n > 1)",
- "name": "French",
- "team": 1
- }
- },
- {
- "pk": 3,
- "model": "languages.language",
- "fields": {
- "locale": "it",
- "plurals": "nplurals=2; plural=(n != 1)",
- "name": "Italian",
- "team": 2
- }
- },
- {
- "pk": 1,
"model": "teams.team",
"fields": {
"mailing_list_subscribe": "http://www.traduc.org/mailman/listinfo/gnomefr",
@@ -183,6 +153,36 @@
},
{
"pk": 1,
+ "model": "languages.language",
+ "fields": {
+ "locale": "en",
+ "plurals": "nplurals=2; plural=(n != 1)",
+ "name": "en",
+ "team": null
+ }
+ },
+ {
+ "pk": 2,
+ "model": "languages.language",
+ "fields": {
+ "locale": "fr",
+ "plurals": "nplurals=2; plural=(n > 1)",
+ "name": "French",
+ "team": 1
+ }
+ },
+ {
+ "pk": 3,
+ "model": "languages.language",
+ "fields": {
+ "locale": "it",
+ "plurals": "nplurals=2; plural=(n != 1)",
+ "name": "Italian",
+ "team": 2
+ }
+ },
+ {
+ "pk": 1,
"model": "stats.module",
"fields": {
"comment": null,
@@ -284,7 +284,8 @@
"dtype": "ui",
"pot_method": null,
"module": 1,
- "linguas_location": null,
+ "linguas_location": null,
+ "red_filter": null,
"directory": "po",
"description": "UI Translations"
}
@@ -298,6 +299,7 @@
"pot_method": null,
"module": 2,
"linguas_location": null,
+ "red_filter": null,
"directory": "po",
"description": "UI Translations"
}
@@ -311,6 +313,7 @@
"pot_method": null,
"module": 3,
"linguas_location": null,
+ "red_filter": null,
"directory": "po",
"description": "UI Translations"
}
@@ -324,6 +327,7 @@
"pot_method": null,
"module": 1,
"linguas_location": null,
+ "red_filter": null,
"directory": "help",
"description": "User Guide"
}
@@ -337,6 +341,7 @@
"pot_method": null,
"module": 2,
"linguas_location": null,
+ "red_filter": null,
"directory": "help",
"description": "User Guide"
}
@@ -350,6 +355,7 @@
"pot_method": null,
"module": 3,
"linguas_location": null,
+ "red_filter": null,
"directory": "help",
"description": "User Guide"
}
@@ -425,296 +431,590 @@
},
{
"pk": 1,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 1,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 47,
+ "fuzzy": 0,
"translated": 0,
- "branch": 1,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 2,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 1,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 47,
- "branch": 1,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 3,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 1,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 7,
+ "fuzzy": 10,
"translated": 30,
- "branch": 1,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 10
+ "path": null
}
},
{
"pk": 4,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 2,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 1,
"untranslated": 20,
+ "fuzzy": 0,
"translated": 0,
- "branch": 1,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 5,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 2,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 20,
- "branch": 1,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 6,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 2,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 20,
- "branch": 1,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 7,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 3,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 136,
+ "fuzzy": 0,
"translated": 0,
- "branch": 2,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 8,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 3,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 136,
- "branch": 2,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 9,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 3,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 6,
+ "fuzzy": 0,
"translated": 130,
- "branch": 2,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 10,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 4,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 11,
"untranslated": 259,
+ "fuzzy": 0,
"translated": 0,
- "branch": 2,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 11,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 4,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 259,
+ "fuzzy": 0,
"translated": 0,
- "branch": 2,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 12,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 4,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 259,
- "branch": 2,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 13,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 3,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 149,
+ "fuzzy": 0,
"translated": 0,
- "branch": 3,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 14,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 3,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 4,
"translated": 255,
- "branch": 3,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 4
+ "path": null
}
},
{
"pk": 15,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 3,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 259,
- "branch": 3,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 16,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 4,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 11,
"untranslated": 259,
+ "fuzzy": 0,
"translated": 0,
- "branch": 3,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 17,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 4,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 259,
+ "fuzzy": 0,
"translated": 0,
- "branch": 3,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 18,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 4,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 0,
"translated": 259,
- "branch": 3,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 19,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 5,
- "language": null,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 626,
+ "fuzzy": 0,
"translated": 0,
- "branch": 4,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 0
+ "path": null
}
},
{
"pk": 20,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 5,
- "language": 2,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 2,
+ "fuzzy": 20,
"translated": 598,
- "branch": 4,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 20
+ "path": null
}
},
{
"pk": 21,
- "model": "stats.statistics",
+ "model": "stats.pofile",
"fields": {
- "domain": 5,
- "language": 3,
+ "updated": "2011-03-23 13:47:59",
"num_figures": 0,
"untranslated": 0,
+ "fuzzy": 6,
"translated": 620,
- "branch": 4,
- "date": "2011-02-17 22:15:33",
- "fuzzy": 6
+ "path": null
+ }
+ },
+ {
+ "pk": 1,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 1,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 1,
+ "language": null,
+ "part_po": null,
+ "branch": 1
+ }
+ },
+ {
+ "pk": 2,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 1,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 2,
+ "language": 2,
+ "part_po": null,
+ "branch": 1
+ }
+ },
+ {
+ "pk": 3,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 1,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 3,
+ "language": 3,
+ "part_po": null,
+ "branch": 1
+ }
+ },
+ {
+ "pk": 4,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 2,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 4,
+ "language": null,
+ "part_po": null,
+ "branch": 1
+ }
+ },
+ {
+ "pk": 5,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 2,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 5,
+ "language": 2,
+ "part_po": null,
+ "branch": 1
+ }
+ },
+ {
+ "pk": 6,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 2,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 6,
+ "language": 3,
+ "part_po": null,
+ "branch": 1
+ }
+ },
+ {
+ "pk": 7,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 3,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 7,
+ "language": null,
+ "part_po": null,
+ "branch": 2
+ }
+ },
+ {
+ "pk": 8,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 3,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 8,
+ "language": 2,
+ "part_po": null,
+ "branch": 2
+ }
+ },
+ {
+ "pk": 9,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 3,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 9,
+ "language": 3,
+ "part_po": null,
+ "branch": 2
+ }
+ },
+ {
+ "pk": 10,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 4,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 10,
+ "language": null,
+ "part_po": null,
+ "branch": 2
+ }
+ },
+ {
+ "pk": 11,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 4,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 11,
+ "language": 2,
+ "part_po": null,
+ "branch": 2
+ }
+ },
+ {
+ "pk": 12,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 4,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 12,
+ "language": 3,
+ "part_po": null,
+ "branch": 2
+ }
+ },
+ {
+ "pk": 13,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 3,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 13,
+ "language": null,
+ "part_po": null,
+ "branch": 3
+ }
+ },
+ {
+ "pk": 14,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 3,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 14,
+ "language": 2,
+ "part_po": null,
+ "branch": 3
+ }
+ },
+ {
+ "pk": 15,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 3,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 15,
+ "language": 3,
+ "part_po": null,
+ "branch": 3
+ }
+ },
+ {
+ "pk": 16,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 4,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 16,
+ "language": null,
+ "part_po": null,
+ "branch": 3
+ }
+ },
+ {
+ "pk": 17,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 4,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 17,
+ "language": 2,
+ "part_po": null,
+ "branch": 3
+ }
+ },
+ {
+ "pk": 18,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 4,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 18,
+ "language": 3,
+ "part_po": null,
+ "branch": 3
+ }
+ },
+ {
+ "pk": 19,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 5,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 19,
+ "language": null,
+ "part_po": null,
+ "branch": 4
+ }
+ },
+ {
+ "pk": 20,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 5,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 20,
+ "language": 2,
+ "part_po": null,
+ "branch": 4
+ }
+ },
+ {
+ "pk": 21,
+ "model": "stats.statistics",
+ "fields": {
+ "domain": 5,
+ "old_translated": 0,
+ "old_date": "2011-03-23 13:47:59",
+ "old_fuzzy": 0,
+ "old_untranslated": 0,
+ "old_num_figures": 0,
+ "full_po": 21,
+ "language": 3,
+ "part_po": null,
+ "branch": 4
}
},
{
@@ -726,4 +1026,4 @@
"description": "Error regenerating POT file for zenity:\n<pre>intltool-update -g 'zenity' -p\nERROR: xgettext failed to generate PO template file.</pre>"
}
}
-]
\ No newline at end of file
+]
diff --git a/stats/tests/fixture_factory.py b/stats/tests/fixture_factory.py
index 1fbbefe..de416f6 100644
--- a/stats/tests/fixture_factory.py
+++ b/stats/tests/fixture_factory.py
@@ -136,7 +136,7 @@ class FixtureFactory(TestCase):
description="Error regenerating POT file for zenity:\n<pre>intltool-update -g 'zenity' -p\nERROR: xgettext failed to generate PO template file.</pre>"))
# Output fixture
- data = Dumpdata().handle(*['auth.User', 'people', 'languages', 'teams', 'stats'],
+ data = Dumpdata().handle(*['auth.User', 'people', 'teams', 'languages', 'stats'],
**{'indent':1})
out_file = NamedTemporaryFile(suffix=".json", dir=".", delete=False)
out_file.write(data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]