'The prepopulation works for existing objects too, as long as
the original field is empty (#19082).'

def test_populate_existing_object(self):

    item = MainPrepopulated.objects.create(name='    this    is    the    mAin    n\xc3\x80M\xc3\xab', pubdate='2012-02-18', status='option    two', slug1='', slug2='')
    self.admin_login(username='super', password='secret', login_url=reverse('admin:index'))
    object_url = (self.live_server_url + reverse('admin:admin_views_mainprepopulated_change', args=(item.id,)))
    self.selenium.get(object_url)
    self.selenium.find_element_by_id('id_name').send_keys('    the    best')
    slug1 = self.selenium.find_element_by_id('id_slug1').get_attribute('value')
    slug2 = self.selenium.find_element_by_id('id_slug2').get_attribute('value')
    self.assertEqual(slug1, 'main-name-best-2012-02-18')
    self.assertEqual(slug2, 'option-two-main-name-best')
    self.selenium.find_element_by_xpath('//input[@value="Save"]').click()
    self.wait_page_loaded()
    self.selenium.get(object_url)
    self.selenium.find_element_by_id('id_name').send_keys('    hello')
    slug1 = self.selenium.find_element_by_id('id_slug1').get_attribute('value')
    slug2 = self.selenium.find_element_by_id('id_slug2').get_attribute('value')
    self.assertEqual(slug1, 'main-name-best-2012-02-18')
    self.assertEqual(slug2, 'option-two-main-name-best')
