summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-29 17:18:13 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-29 17:18:13 +0200
commit5aeac85e4822e100e0cf3e55e2ca0ee10dc3e5d1 (patch)
tree5398a3ece1bf7177ba2c6b1af8e66820201b39fa /ishtar_common/tests.py
parentfafc9a0a3926e254a0a21d1076a77aeddeca9580 (diff)
downloadIshtar-5aeac85e4822e100e0cf3e55e2ca0ee10dc3e5d1.tar.bz2
Ishtar-5aeac85e4822e100e0cf3e55e2ca0ee10dc3e5d1.zip
Automatically generate raw_name on save for person - formula set in profile
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 5add2e2cf..a4d354eb1 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -314,3 +314,13 @@ class IshtarSiteProfileTest(TestCase):
profile.save()
response = c.get(reverse('start'))
self.assertTrue("section-file_management" in response.content)
+
+ def testExternalKey(self):
+ profile = models.get_current_profile()
+ p = models.Person.objects.create(name='plouf', surname=u'Tégada')
+ self.assertEqual(p.raw_name, u"PLOUF Tégada")
+ profile.person_raw_name = u'{surname|slug} {name}'
+ profile.save()
+ p.raw_name = ''
+ p.save()
+ self.assertEqual(p.raw_name, u"tegada plouf")