Commit d5d7a648 authored by Claude Paroz's avatar Claude Paroz

Add test and minor admin improvements

parent 8ac57f4c
......@@ -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)
......
......@@ -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')
......
......@@ -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()
......
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