"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".

Replace these with more appropriate tests for your application.
"""

from django.test import TestCase
from django.core.files import File
from app1.models import M1

class SimpleTest(TestCase):
    def test_basic_addition(self):
        m1 = M1()
        m1.title = "aaa"
        m1.img1 = File(open("/tmp/p5/twitter.jpg"))
        m1.save()
        
        p = M1.objects.get(id=1).img1.path
        
        self.failUnless(open(p), 'file not found')