from armstrong.dev.tests.utils import ArmstrongTestCase
import random


def random_range():
    # TODO: make sure this can only be generated once
    return range(random.randint(1000, 2000))


class HatbandTestCase(ArmstrongTestCase):
    pass


class HatbandTestMixin(object):

    script_code = """
    <script type="text/javascript" src="/static/ckeditor/ckeditor.js"></script>
    """.strip()
    textarea_code = 'class="ckeditor"></textarea>'

    def assertCkEditorPresent(self, response):
        self.assertContains(response, self.script_code)
        self.assertContains(response, self.textarea_code)

    def assertCkEditorNotPresent(self, response):
        self.assertNotContains(response, self.script_code)
        self.assertNotContains(response, self.textarea_code)

[((7, 17, 7, 43), 'random.randint', 'random.randint', ({(7, 32, 7, 36): '(1000)', (7, 38, 7, 42): '(2000)'}, {}), '(1000, 2000)', False, 'import random\n')]