diff options
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', | 
