# Path: tinymce_4/widgets.py
# class TinyMCEWidget(forms.Textarea):
#     '''
#     Textarea form widget with support TinyMCE.
#     See: http://www.tinymce.com/wiki.php/TinyMCE
#     '''
# 
#     tiny_class = 'tinymce4'
# 
#     def __init__(self, attrs={}):
#         css_class = attrs.get('class', '')
#         attrs['class'] = ' '.join([self.tiny_class, css_class])
#         super().__init__(attrs)
# 
#     class Media:
#         css = {
#             'all': ('tinymce_4/settings/django-grapelli.css',)
#         }
#         js = [
#             'tinymce_4/tinymce/tinymce.min.js',
#             'tinymce_4/settings/tinymce_initialization.js',
#             'tinymce_4/settings/django-filebrowser.js',
#         ]


from django.urls import reverse
from django.contrib.auth.models import User
from django.test import Client, TestCase
from tinymce_4.widgets import TinyMCEWidget
# -*- coding: utf-8 -*-




class TinyMCETestCase(TestCase):

    def setUp(self):
        self.client = Client()
        user = User.objects.first()
        self.client.force_login(user)

    def test(self):
        url = reverse('admin:tiny_example_tinyexample_add')
        response = self.client.get(url)


# Path: tinymce_4/widgets.py
# class TinyMCEWidget(forms.Textarea):
#     '''
#     Textarea form widget with support TinyMCE.
#     See: http://www.tinymce.com/wiki.php/TinyMCE
#     '''
# 
#     tiny_class = 'tinymce4'
# 
#     def __init__(self, attrs={}):
#         css_class = attrs.get('class', '')
#         attrs['class'] = ' '.join([self.tiny_class, css_class])
#         super().__init__(attrs)
# 
#     class Media:
#         css = {
#             'all': ('tinymce_4/settings/django-grapelli.css',)
#         }
#         js = [
#             'tinymce_4/tinymce/tinymce.min.js',
#             'tinymce_4/settings/tinymce_initialization.js',
#             'tinymce_4/settings/django-filebrowser.js',
#         ]


# Path: example/tiny_example/tests.py
from django.urls import reverse
from django.contrib.auth.models import User
from django.test import Client, TestCase
from tinymce_4.widgets import TinyMCEWidget

# -*- coding: utf-8 -*-




class TinyMCETestCase(TestCase):

    def setUp(self):
        self.client = Client()
        user = User.objects.first()
        self.client.force_login(user)

    def test(self):
        url = reverse('admin:tiny_example_tinyexample_add')
        response = self.client.get(url)


        self.assertContains(response, TinyMCEWidget.tiny_class)