def setUp(self): self.test_snippet = Advert() self.test_snippet.text = 'test_advert' self.test_snippet.url = 'http://www.example.com/' self.test_snippet.save() login(self.client)
def setUp(self): content_type = get_content_type_from_url_params('tests', 'advert') test_snippet = Advert() test_snippet.text = 'test_advert' test_snippet.url = 'http://www.example.com/' test_snippet.save() edit_handler_class = get_snippet_edit_handler(Advert) form_class = edit_handler_class.get_form_class(Advert) form = form_class(instance=test_snippet) self.snippet_chooser_panel_class = SnippetChooserPanel( 'text', content_type) self.snippet_chooser_panel = self.snippet_chooser_panel_class( instance=test_snippet, form=form)