You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
746 B
22 lines
746 B
from django.test import TestCase
|
|
import models
|
|
from django.contrib.auth.models import User
|
|
|
|
|
|
class PaysTest(TestCase):
|
|
|
|
def setUp(self):
|
|
self.msg = models.PrivateMessages.objects.create(
|
|
sender=User.objects.all()[0],
|
|
recepient=User.objects.all()[0],
|
|
text='test init text'
|
|
)
|
|
|
|
def tearDown(self):
|
|
models.PrivateMessages.objects.all().delete()
|
|
|
|
def check_ret_msgs(self):
|
|
"""check return messages"""
|
|
request = self.factory.get('/message/')
|
|
self.assertIsInstance(models.PrivateMessages.objects.get_my_messages(request), int, 'checking ret type')
|
|
self.assertGreater(models.PrivateMessages.objects.get_my_messages(request), 0, 'checking msg count')
|