[damned-lies] Add test and minor admin improvements
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Add test and minor admin improvements
- Date: Fri, 10 Jun 2011 21:49:12 +0000 (UTC)
commit d5d7a648361a138a207ab496f6effd9fb5ec4da6
Author: Claude Paroz <claude 2xlibre net>
Date: Fri Jun 10 23:46:44 2011 +0200
Add test and minor admin improvements
stats/admin.py | 1 +
vertimus/admin.py | 1 +
vertimus/tests/__init__.py | 11 +++++++++++
3 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/stats/admin.py b/stats/admin.py
index cb4cbf4..e602baf 100644
--- a/stats/admin.py
+++ b/stats/admin.py
@@ -120,6 +120,7 @@ class InformationInline(admin.TabularInline):
class StatisticsAdmin(admin.ModelAdmin):
search_fields = ('language__name', 'branch__module__name')
+ raw_id_fields = ('branch', 'domain', 'language', 'full_po', 'part_po')
inlines = [ InformationInline ]
admin.site.register(Statistics, StatisticsAdmin)
diff --git a/vertimus/admin.py b/vertimus/admin.py
index b3a56eb..e4af7aa 100644
--- a/vertimus/admin.py
+++ b/vertimus/admin.py
@@ -5,6 +5,7 @@ from vertimus.models import State, Action
class StateAdmin(admin.ModelAdmin):
raw_id_fields = ('branch', 'domain', 'person',)
+ search_fields = ('branch__module__name',)
class ActionAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'state_db')
diff --git a/vertimus/tests/__init__.py b/vertimus/tests/__init__.py
index 620edb6..e31d2b9 100644
--- a/vertimus/tests/__init__.py
+++ b/vertimus/tests/__init__.py
@@ -362,6 +362,17 @@ class VertimusTest(TeamsAndRolesTests):
self.assertEqual(state.name, 'Translated')
+ def test_delete(self):
+ """ Test that a whole module tree can be properly deleted """
+ state = StateNone(branch=self.b, domain=self.d, language=self.l)
+ state.save()
+
+ action = Action.new_by_name('WC', person=self.pt, comment="Hi!")
+ action.apply_on(state)
+
+ self.m.delete()
+ self.assertEqual(Action.objects.all().count(), 0)
+
def test_vertimus_view(self):
pot_stat = Statistics(language=None, branch=self.b, domain=self.d)
pot_stat.save()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]