def test_edit_preserves_creator(self):
        orig_user = self._get_user(username='orig_user')
        badge = Badge(creator=orig_user, title="Test 3",
                      description="Another test")
        badge.save()

        edit_user = self._get_user(username='edit_user')
        edit_user.is_superuser = True
        edit_user.save()

        self.client.login(username="edit_user", password="trustno1")
        edit_url = reverse('badger.views.edit',
                args=(badge.slug,))
        r = self.client.post(edit_url, dict(
            title='New Title',
        ), follow=True)
        doc = pq(r.content)

        # The badge's creator should not have changed to the editing user.
        badge_after = Badge.objects.get(pk=badge.pk)
        ok_(badge_after.creator.pk != edit_user.pk)
Edit preserves the original creator of the badge (bugfix)
dataset/ETHPy150Open mozilla/django-badger/badger/tests/test_views.py/BadgerViewsTest.test_edit_preserves_creator