[damned-lies] Improve sample data
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Improve sample data
- Date: Mon, 8 Aug 2011 20:45:15 +0000 (UTC)
commit 5af97ff9c313323a23f25d784f62fb8468db04be
Author: Claude Paroz <claude 2xlibre net>
Date: Mon Aug 8 22:42:51 2011 +0200
Improve sample data
stats/fixtures/sample_data.json | 148 +++++++++++++++++++++------------------
stats/tests/fixture_factory.py | 65 ++++++++++++------
2 files changed, 123 insertions(+), 90 deletions(-)
---
diff --git a/stats/fixtures/sample_data.json b/stats/fixtures/sample_data.json
index c6c73e2..f9563ae 100644
--- a/stats/fixtures/sample_data.json
+++ b/stats/fixtures/sample_data.json
@@ -9,12 +9,12 @@
"is_active": true,
"is_superuser": false,
"is_staff": false,
- "last_login": "2011-08-04 12:03:53",
+ "last_login": "2011-08-08 22:23:57",
"groups": [],
"user_permissions": [],
"password": "!",
"email": "bob example org",
- "date_joined": "2011-08-04 12:03:53"
+ "date_joined": "2011-08-08 22:23:57"
}
},
{
@@ -27,12 +27,12 @@
"is_active": true,
"is_superuser": false,
"is_staff": false,
- "last_login": "2011-08-04 12:03:53",
+ "last_login": "2011-08-08 22:23:57",
"groups": [],
"user_permissions": [],
"password": "!",
"email": "coord example org",
- "date_joined": "2011-08-04 12:03:53"
+ "date_joined": "2011-08-08 22:23:57"
}
},
{
@@ -45,12 +45,12 @@
"is_active": true,
"is_superuser": false,
"is_staff": false,
- "last_login": "2011-08-04 12:03:53",
+ "last_login": "2011-08-08 22:23:57",
"groups": [],
"user_permissions": [],
"password": "!",
"email": "alessio example org",
- "date_joined": "2011-08-04 12:03:53"
+ "date_joined": "2011-08-08 22:23:57"
}
},
{
@@ -152,6 +152,16 @@
}
},
{
+ "pk": 4,
+ "model": "languages.language",
+ "fields": {
+ "locale": "bem",
+ "plurals": "",
+ "name": "Bemba",
+ "team": null
+ }
+ },
+ {
"pk": 1,
"model": "languages.language",
"fields": {
@@ -436,7 +446,7 @@
"pk": 1,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 47,
"figures": null,
"fuzzy": 0,
@@ -448,7 +458,7 @@
"pk": 2,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -460,7 +470,7 @@
"pk": 3,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 7,
"figures": null,
"fuzzy": 10,
@@ -472,7 +482,7 @@
"pk": 4,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 20,
"figures": null,
"fuzzy": 0,
@@ -484,7 +494,7 @@
"pk": 5,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -496,7 +506,7 @@
"pk": 6,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -508,7 +518,7 @@
"pk": 7,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 136,
"figures": null,
"fuzzy": 0,
@@ -520,7 +530,7 @@
"pk": 8,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -532,7 +542,7 @@
"pk": 9,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 6,
"figures": null,
"fuzzy": 0,
@@ -544,7 +554,7 @@
"pk": 10,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 259,
"figures": null,
"fuzzy": 0,
@@ -556,7 +566,7 @@
"pk": 11,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 259,
"figures": null,
"fuzzy": 0,
@@ -568,7 +578,7 @@
"pk": 12,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -580,7 +590,7 @@
"pk": 13,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 149,
"figures": null,
"fuzzy": 0,
@@ -592,7 +602,7 @@
"pk": 14,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 4,
@@ -604,7 +614,7 @@
"pk": 15,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -616,7 +626,7 @@
"pk": 16,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 259,
"figures": null,
"fuzzy": 0,
@@ -628,7 +638,7 @@
"pk": 17,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 259,
"figures": null,
"fuzzy": 0,
@@ -640,7 +650,7 @@
"pk": 18,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 0,
@@ -652,7 +662,7 @@
"pk": 19,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 626,
"figures": null,
"fuzzy": 0,
@@ -664,7 +674,7 @@
"pk": 20,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 2,
"figures": null,
"fuzzy": 20,
@@ -676,7 +686,7 @@
"pk": 21,
"model": "stats.pofile",
"fields": {
- "updated": "2011-08-04 12:03:53",
+ "updated": "2011-08-08 22:23:57",
"untranslated": 0,
"figures": null,
"fuzzy": 6,
@@ -690,12 +700,12 @@
"fields": {
"domain": 1,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 1,
"language": null,
- "part_po": null,
+ "part_po": 1,
"branch": 1
}
},
@@ -705,12 +715,12 @@
"fields": {
"domain": 1,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 2,
"language": 2,
- "part_po": null,
+ "part_po": 2,
"branch": 1
}
},
@@ -720,12 +730,12 @@
"fields": {
"domain": 1,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 3,
"language": 3,
- "part_po": null,
+ "part_po": 3,
"branch": 1
}
},
@@ -735,12 +745,12 @@
"fields": {
"domain": 2,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 4,
"language": null,
- "part_po": null,
+ "part_po": 4,
"branch": 1
}
},
@@ -750,12 +760,12 @@
"fields": {
"domain": 2,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 5,
"language": 2,
- "part_po": null,
+ "part_po": 5,
"branch": 1
}
},
@@ -765,12 +775,12 @@
"fields": {
"domain": 2,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 6,
"language": 3,
- "part_po": null,
+ "part_po": 6,
"branch": 1
}
},
@@ -780,12 +790,12 @@
"fields": {
"domain": 3,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 7,
"language": null,
- "part_po": null,
+ "part_po": 7,
"branch": 2
}
},
@@ -795,12 +805,12 @@
"fields": {
"domain": 3,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 8,
"language": 2,
- "part_po": null,
+ "part_po": 8,
"branch": 2
}
},
@@ -810,12 +820,12 @@
"fields": {
"domain": 3,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 9,
"language": 3,
- "part_po": null,
+ "part_po": 9,
"branch": 2
}
},
@@ -825,12 +835,12 @@
"fields": {
"domain": 4,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 10,
"language": null,
- "part_po": null,
+ "part_po": 10,
"branch": 2
}
},
@@ -840,12 +850,12 @@
"fields": {
"domain": 4,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 11,
"language": 2,
- "part_po": null,
+ "part_po": 11,
"branch": 2
}
},
@@ -855,12 +865,12 @@
"fields": {
"domain": 4,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 12,
"language": 3,
- "part_po": null,
+ "part_po": 12,
"branch": 2
}
},
@@ -870,12 +880,12 @@
"fields": {
"domain": 3,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 13,
"language": null,
- "part_po": null,
+ "part_po": 13,
"branch": 3
}
},
@@ -885,12 +895,12 @@
"fields": {
"domain": 3,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 14,
"language": 2,
- "part_po": null,
+ "part_po": 14,
"branch": 3
}
},
@@ -900,12 +910,12 @@
"fields": {
"domain": 3,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 15,
"language": 3,
- "part_po": null,
+ "part_po": 15,
"branch": 3
}
},
@@ -915,12 +925,12 @@
"fields": {
"domain": 4,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 16,
"language": null,
- "part_po": null,
+ "part_po": 16,
"branch": 3
}
},
@@ -930,12 +940,12 @@
"fields": {
"domain": 4,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 17,
"language": 2,
- "part_po": null,
+ "part_po": 17,
"branch": 3
}
},
@@ -945,12 +955,12 @@
"fields": {
"domain": 4,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 18,
"language": 3,
- "part_po": null,
+ "part_po": 18,
"branch": 3
}
},
@@ -960,12 +970,12 @@
"fields": {
"domain": 5,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 19,
"language": null,
- "part_po": null,
+ "part_po": 19,
"branch": 4
}
},
@@ -975,12 +985,12 @@
"fields": {
"domain": 5,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 20,
"language": 2,
- "part_po": null,
+ "part_po": 20,
"branch": 4
}
},
@@ -990,12 +1000,12 @@
"fields": {
"domain": 5,
"old_translated": 0,
- "old_date": "2011-08-04 12:03:53",
+ "old_date": "2011-08-08 22:23:57",
"old_fuzzy": 0,
"old_untranslated": 0,
"full_po": 21,
"language": 3,
- "part_po": null,
+ "part_po": 21,
"branch": 4
}
},
diff --git a/stats/tests/fixture_factory.py b/stats/tests/fixture_factory.py
index ca7c40c..521fe6f 100644
--- a/stats/tests/fixture_factory.py
+++ b/stats/tests/fixture_factory.py
@@ -30,6 +30,8 @@ class FixtureFactory(TestCase):
team=t1)
l_it = Language.objects.create(name='Italian', locale='it', plurals="nplurals=2; plural=(n != 1)",
team=t2)
+ # Lang with no team and no stats
+ l_bem = Language.objects.create(name='Bemba', locale='bem')
# Creating models: Persons/Roles
p0 = Person.objects.create(username='admin1') # Fake person (deleted below), just not to use pk=1 for user
@@ -106,29 +108,50 @@ class FixtureFactory(TestCase):
# Creating models: Statistics
# gnome-hello ui, gnome-hello doc (POT, fr, it)
- Statistics.objects.create(branch=b1, domain=dom['gnome-hello-ui'], language=None, full_po=PoFile.objects.create(untranslated=47))
- Statistics.objects.create(branch=b1, domain=dom['gnome-hello-ui'], language=l_fr, full_po=PoFile.objects.create(translated=47))
- Statistics.objects.create(branch=b1, domain=dom['gnome-hello-ui'], language=l_it, full_po=PoFile.objects.create(translated=30, fuzzy=10, untranslated=7))
- Statistics.objects.create(branch=b1, domain=dom['gnome-hello-doc'], language=None, full_po=PoFile.objects.create(untranslated=20))
- Statistics.objects.create(branch=b1, domain=dom['gnome-hello-doc'], language=l_fr, full_po=PoFile.objects.create(translated=20))
- Statistics.objects.create(branch=b1, domain=dom['gnome-hello-doc'], language=l_it, full_po=PoFile.objects.create(translated=20))
+ pofile = PoFile.objects.create(untranslated=47)
+ Statistics.objects.create(branch=b1, domain=dom['gnome-hello-ui'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=47)
+ Statistics.objects.create(branch=b1, domain=dom['gnome-hello-ui'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=30, fuzzy=10, untranslated=7)
+ Statistics.objects.create(branch=b1, domain=dom['gnome-hello-ui'], language=l_it, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(untranslated=20)
+ Statistics.objects.create(branch=b1, domain=dom['gnome-hello-doc'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=20)
+ Statistics.objects.create(branch=b1, domain=dom['gnome-hello-doc'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=20)
+ Statistics.objects.create(branch=b1, domain=dom['gnome-hello-doc'], language=l_it, full_po=pofile, part_po=pofile)
# zenity ui 2.30, zenity doc 2.30, zenity ui master, zenity doc master (POT, fr, it)
- Statistics.objects.create(branch=b2, domain=dom['zenity-ui'], language=None, full_po=PoFile.objects.create(untranslated=136))
- Statistics.objects.create(branch=b2, domain=dom['zenity-ui'], language=l_fr, full_po=PoFile.objects.create(translated=136))
- Statistics.objects.create(branch=b2, domain=dom['zenity-ui'], language=l_it, full_po=PoFile.objects.create(translated=130, untranslated=6))
- Statistics.objects.create(branch=b2, domain=dom['zenity-doc'], language=None, full_po=PoFile.objects.create(untranslated=259))
- Statistics.objects.create(branch=b2, domain=dom['zenity-doc'], language=l_fr, full_po=PoFile.objects.create(untranslated=259))
- Statistics.objects.create(branch=b2, domain=dom['zenity-doc'], language=l_it, full_po=PoFile.objects.create(translated=259))
- stat1 = Statistics.objects.create(branch=b3, domain=dom['zenity-ui'], language=None, full_po=PoFile.objects.create(untranslated=149))
- Statistics.objects.create(branch=b3, domain=dom['zenity-ui'], language=l_fr, full_po=PoFile.objects.create(translated=255, fuzzy=4))
- Statistics.objects.create(branch=b3, domain=dom['zenity-ui'], language=l_it, full_po=PoFile.objects.create(translated=259))
- Statistics.objects.create(branch=b3, domain=dom['zenity-doc'], language=None, full_po=PoFile.objects.create(untranslated=259))
- Statistics.objects.create(branch=b3, domain=dom['zenity-doc'], language=l_fr, full_po=PoFile.objects.create(untranslated=259))
- Statistics.objects.create(branch=b3, domain=dom['zenity-doc'], language=l_it, full_po=PoFile.objects.create(translated=259))
+ pofile = PoFile.objects.create(untranslated=136)
+ Statistics.objects.create(branch=b2, domain=dom['zenity-ui'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=136)
+ Statistics.objects.create(branch=b2, domain=dom['zenity-ui'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=130, untranslated=6)
+ Statistics.objects.create(branch=b2, domain=dom['zenity-ui'], language=l_it, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(untranslated=259)
+ Statistics.objects.create(branch=b2, domain=dom['zenity-doc'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(untranslated=259)
+ Statistics.objects.create(branch=b2, domain=dom['zenity-doc'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=259)
+ Statistics.objects.create(branch=b2, domain=dom['zenity-doc'], language=l_it, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(untranslated=149)
+ stat1 = Statistics.objects.create(branch=b3, domain=dom['zenity-ui'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=255, fuzzy=4)
+ Statistics.objects.create(branch=b3, domain=dom['zenity-ui'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=259)
+ Statistics.objects.create(branch=b3, domain=dom['zenity-ui'], language=l_it, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(untranslated=259)
+ Statistics.objects.create(branch=b3, domain=dom['zenity-doc'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(untranslated=259)
+ Statistics.objects.create(branch=b3, domain=dom['zenity-doc'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=259)
+ Statistics.objects.create(branch=b3, domain=dom['zenity-doc'], language=l_it, full_po=pofile, part_po=pofile)
# shared-mime-info ui (POT, fr, it)
- Statistics.objects.create(branch=b4, domain=dom['shared-mime-info-ui'], language=None, full_po=PoFile.objects.create(untranslated=626))
- Statistics.objects.create(branch=b4, domain=dom['shared-mime-info-ui'], language=l_fr, full_po=PoFile.objects.create(translated=598, fuzzy=20, untranslated=2))
- Statistics.objects.create(branch=b4, domain=dom['shared-mime-info-ui'], language=l_it, full_po=PoFile.objects.create(translated=620, fuzzy=6))
+ pofile = PoFile.objects.create(untranslated=626)
+ Statistics.objects.create(branch=b4, domain=dom['shared-mime-info-ui'], language=None, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=598, fuzzy=20, untranslated=2)
+ Statistics.objects.create(branch=b4, domain=dom['shared-mime-info-ui'], language=l_fr, full_po=pofile, part_po=pofile)
+ pofile = PoFile.objects.create(translated=620, fuzzy=6)
+ Statistics.objects.create(branch=b4, domain=dom['shared-mime-info-ui'], language=l_it, full_po=pofile, part_po=pofile)
# Example of error
stat1.information_set.add(Information(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]