old_contents: from djangosanetesting.cases import DatabaseTestCase
  
  from djangomarkup.fields import RichTextField
  from djangomarkup.models import SourceText
  
  from exampleapp.models import Article
  
  class TestRichTextField(DatabaseTestCase):
  
      def setUp(self):
          super(TestRichTextField, self).setUp()
          self.field = RichTextField(
              instance = Article(),
              model = Article,
              syntax_processor_name = "markdown",
              field_name = "text",
              required = True,
              label = "Text"
          )
  
  
      def test_retrieve_empty_source_for_empty_article(self):
          self.assert_equals(u'', self.field.get_source().content)
  
      def test_source_available_for_empty_article(self):
          self.assert_equals(u'', self.field.get_source_text())
  
      def test_render_available_for_empty_article(self):
          self.assert_equals(u'<p></p>', self.field.get_rendered_text().strip())
  
  
new_contents: from djangosanetesting.cases import UnitTestCase
  
  from djangomarkup.fields import RichTextField
  
  from exampleapp.models import Article
  
  class TestRichTextField(UnitTestCase):
  
      def setUp(self):
          super(TestRichTextField, self).setUp()
          self.field = RichTextField(
              instance = Article(),
              model = Article,
              syntax_processor_name = "markdown",
              field_name = "text",
              required = True,
              label = "Text"
          )
  
  
      def test_retrieve_empty_source_for_empty_article(self):
          self.assert_equals(u'', self.field.get_source().content)
  
      def test_source_available_for_empty_article(self):
          self.assert_equals(u'', self.field.get_source_text())
  
      def test_render_available_for_empty_article(self):
          self.assert_equals(u'<p></p>', self.field.get_rendered_text().strip())
  
      def test_value_error_raised_when_accessing_source_without_instance(self):
          field = RichTextField(
              instance = None,
              model = Article,
              syntax_processor_name = "markdown",
              field_name = "text",
              required = True,
              label = "Text"
          )
  
          self.assert_raises(ValueError, field.get_source)
subject: Check proper error when accessing source without instance