Commit 6e889ab0 authored by Claude Paroz's avatar Claude Paroz

Do not use pk=1 for a User in sample_data fixture

parent a58519a2
......@@ -40,7 +40,7 @@ def index(request):
translator_credits = translator_credits.split('\n')
curlang = Language.get_language_from_ianacode(request.LANGUAGE_CODE)
if curlang.locale == 'en':
if curlang and curlang.locale == 'en':
curlang = None
context = {
......
[
{
"pk": 1,
"pk": 2,
"model": "auth.user",
"fields": {
"username": "bob",
......@@ -18,7 +18,7 @@
}
},
{
"pk": 2,
"pk": 3,
"model": "auth.user",
"fields": {
"username": "coord",
......@@ -36,7 +36,7 @@
}
},
{
"pk": 3,
"pk": 4,
"model": "auth.user",
"fields": {
"username": "alessio",
......@@ -54,35 +54,35 @@
}
},
{
"pk": 3,
"pk": 2,
"model": "people.person",
"fields": {
"bugzilla_account": null,
"groups": [],
"image": null,
"activation_key": null,
"irc_nick": null,
"svn_account": null,
"irc_nick": "bobby",
"svn_account": "bob1",
"webpage_url": null,
"user_permissions": []
}
},
{
"pk": 1,
"pk": 3,
"model": "people.person",
"fields": {
"bugzilla_account": null,
"groups": [],
"image": null,
"activation_key": null,
"irc_nick": "bobby",
"svn_account": "bob1",
"irc_nick": null,
"svn_account": "coord_fr",
"webpage_url": null,
"user_permissions": []
}
},
{
"pk": 2,
"pk": 4,
"model": "people.person",
"fields": {
"bugzilla_account": null,
......@@ -90,7 +90,7 @@
"image": null,
"activation_key": null,
"irc_nick": null,
"svn_account": "coord_fr",
"svn_account": null,
"webpage_url": null,
"user_permissions": []
}
......@@ -155,7 +155,8 @@
"pk": 1,
"model": "teams.role",
"fields": {
"person": 1,
"is_active": true,
"person": 2,
"role": "translator",
"team": 1
}
......@@ -164,7 +165,8 @@
"pk": 2,
"model": "teams.role",
"fields": {
"person": 2,
"is_active": true,
"person": 3,
"role": "coordinator",
"team": 1
}
......@@ -173,7 +175,8 @@
"pk": 3,
"model": "teams.role",
"fields": {
"person": 3,
"is_active": true,
"person": 4,
"role": "reviewer",
"team": 2
}
......@@ -714,4 +717,4 @@
"fuzzy": 6
}
}
]
\ No newline at end of file
]
......@@ -37,6 +37,7 @@ class FixtureFactory(TestCase):
l_it.save()
# Creating models: Persons/Roles
p0 = Person.objects.create(username='admin1') # Fake person (deleted below), just not to use pk=1 for user
p1 = Person(first_name='Robert', last_name='Translator',
email='bob@example.org', username='bob', irc_nick='bobby',
svn_account='bob1')
......@@ -56,6 +57,7 @@ class FixtureFactory(TestCase):
p1.set_password('alessio')
r3 = Role(team=t2, person=p3, role='reviewer')
r3.save()
p0.delete()
# Creating models: Modules
gnome_hello = Module(name="gnome-hello", vcs_type="git",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment