diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-03-25 19:10:36 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-06-17 13:21:27 +0200 | 
| commit | c8831c9334f86b163b91bbb98c27d0cd3dc41882 (patch) | |
| tree | ea15696b3e5e0d34d158131fb22c72fdf8ea3df5 /ishtar_common/tests.py | |
| parent | 951c06308d822f420083d00734b84206fa3bc1d7 (diff) | |
| download | Ishtar-c8831c9334f86b163b91bbb98c27d0cd3dc41882.tar.bz2 Ishtar-c8831c9334f86b163b91bbb98c27d0cd3dc41882.zip | |
Fix new author creation when no cached label is calculated
Diffstat (limited to 'ishtar_common/tests.py')
| -rw-r--r-- | ishtar_common/tests.py | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 7cc802ec9..01aba1f5b 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -1747,6 +1747,37 @@ class GeomaticTest(TestCase):          self.assertIsNotNone(obj.point) +class NewItems(TestCase): +    fixtures = COMMON_FIXTURES + +    def setUp(self): +        self.username, self.password, self.user = create_superuser() + +    def test_new_author(self): +        url = 'new-author' +        person = models.Person.objects.create( +            name="Hop", surname="Oups" +        ) + +        c = Client() +        # TODO +        # response = c.get(reverse(url)) +        # self.assertEqual(response.status_code, 404) +        c.login(username=self.username, password=self.password) +        response = c.get(reverse(url)) +        self.assertEqual(response.status_code, 200) + +        response = c.post( +            reverse(url), +            {"person": person.id, +             "author_type": models.AuthorType.objects.all()[0].pk} +        ) +        self.assertEqual(response.status_code, 200) +        self.assertEqual(person.author.count(), 1) + + + +  class AccountWizardTest(WizardTest, TestCase):      fixtures = [settings.ROOT_PATH +                  '../fixtures/initial_data-auth-fr.json', | 
