# Path: papers/models.py
# PUBLICATION_TYPES = (
# 	('Most Common', (
# 			('journal-article','Journal Article'),
# 			('book-section', 'Book Section'),
# 			)
# 	),
# 	('Less Common', (		
# 		('bill', 'Bill'),
# 		('book', 'Book'),
# 		('case', 'Case'),
# 		('computer-program', 'Computer Program'),
# 		('conference-proceedings', 'Conference Proceedings'),
# 		('encyclopedia-article', 'Encyclopedia Article'),
# 		('film', 'Film'),
# 		('generic', 'Generic'),
# 		('magazine-article','Magazine Article'),
# 		('newspaper-article','Newspaper Article'),
# 		('patent', 'Patent'),
# 		('report','Report'),
# 		('statute', 'Statute'),
# 		('television-broadcast', 'Television Broadcast'),
# 		('web-page', 'Web Page'),
# 		)
# 	),
# )
# class Publication(models.Model):
#     class Meta:
# class AuthorDetails(models.Model):
#     class Meta:
# class Commentary(models.Model):
#     class Meta:
# class AuthorContributions(models.Model):
#     def doi_link(self):
#     def full_pmcid(self):
#     def link(self):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def save(self, *args, **kwargs):
#     def __unicode__(self):
#     def name(self):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def __unicode__(self):


from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from papers.models import Publication, AuthorDetails, Person, Commentary
        self.test_user.is_active = True
        self.test_user.save()
        self.assertEqual(self.test_user.is_superuser, True)
        login = self.client.login(username='testuser', password='testpassword')
        self.failUnless(login, 'Could not log in')
    
    def tearDown(self):
        '''Depopulate created model instances from test database.'''
        for model in MODELS:
            for obj in model.objects.all():
                obj.delete()
                
    def test_create_new_paper_minimum(self):
        '''This test creates a :class:`~papers.models.Publication` with the required information only.'''
        test_publication = Publication(title='Test Publication.', laboratory_paper=True, interesting_paper=False, preprint=False)
        test_publication.save()
        self.assertEqual(test_publication.pk, 3)
        
    #def test_create_new_paper_all(self):
        #'''This test creates a `::class:Publication` with the required information only.'''
        #test_publication = Publication(title='Test Publication') #add more fields
        #test_publication.save()        
        
    def test_paper_unicode(self):
        '''This tests the unicode representation of a :class:`~papers.models.Publication`.'''
        test_publication = Publication.objects.get(title_slug='14-3-3-proteins-a-number-of-functions-for-a-numbered-protein', laboratory_paper=True, interesting_paper=False, preprint=False)
        self.assertEqual(test_publication.__unicode__(), "14-3-3 proteins: a number of functions for a numbered protein.")
        
    def test_paper_title_slug(self):
        '''This tests the title_slug field of a :class:`~papers.models.Publication`.'''

# Path: papers/models.py
# PUBLICATION_TYPES = (
# 	('Most Common', (
# 			('journal-article','Journal Article'),
# 			('book-section', 'Book Section'),
# 			)
# 	),
# 	('Less Common', (		
# 		('bill', 'Bill'),
# 		('book', 'Book'),
# 		('case', 'Case'),
# 		('computer-program', 'Computer Program'),
# 		('conference-proceedings', 'Conference Proceedings'),
# 		('encyclopedia-article', 'Encyclopedia Article'),
# 		('film', 'Film'),
# 		('generic', 'Generic'),
# 		('magazine-article','Magazine Article'),
# 		('newspaper-article','Newspaper Article'),
# 		('patent', 'Patent'),
# 		('report','Report'),
# 		('statute', 'Statute'),
# 		('television-broadcast', 'Television Broadcast'),
# 		('web-page', 'Web Page'),
# 		)
# 	),
# )
# class Publication(models.Model):
#     class Meta:
# class AuthorDetails(models.Model):
#     class Meta:
# class Commentary(models.Model):
#     class Meta:
# class AuthorContributions(models.Model):
#     def doi_link(self):
#     def full_pmcid(self):
#     def link(self):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def save(self, *args, **kwargs):
#     def __unicode__(self):
#     def name(self):
#     def __unicode__(self):
#     def get_absolute_url(self):
#     def __unicode__(self):


# Path: papers/tests.py
from django.test import TestCase
from django.test.client import Client
from django.contrib.auth.models import User
from papers.models import Publication, AuthorDetails, Person, Commentary

        self.test_user.is_active = True
        self.test_user.save()
        self.assertEqual(self.test_user.is_superuser, True)
        login = self.client.login(username='testuser', password='testpassword')
        self.failUnless(login, 'Could not log in')
    
    def tearDown(self):
        '''Depopulate created model instances from test database.'''
        for model in MODELS:
            for obj in model.objects.all():
                obj.delete()
                
    def test_create_new_paper_minimum(self):
        '''This test creates a :class:`~papers.models.Publication` with the required information only.'''
        test_publication = Publication(title='Test Publication.', laboratory_paper=True, interesting_paper=False, preprint=False)
        test_publication.save()
        self.assertEqual(test_publication.pk, 3)
        
    #def test_create_new_paper_all(self):
        #'''This test creates a `::class:Publication` with the required information only.'''
        #test_publication = Publication(title='Test Publication') #add more fields
        #test_publication.save()        
        
    def test_paper_unicode(self):
        '''This tests the unicode representation of a :class:`~papers.models.Publication`.'''
        test_publication = Publication.objects.get(title_slug='14-3-3-proteins-a-number-of-functions-for-a-numbered-protein', laboratory_paper=True, interesting_paper=False, preprint=False)
        self.assertEqual(test_publication.__unicode__(), "14-3-3 proteins: a number of functions for a numbered protein.")
        
    def test_paper_title_slug(self):
        '''This tests the title_slug field of a :class:`~papers.models.Publication`.'''

        test_publication = Publication(title='Test Publication.', laboratory_paper=True, interesting_paper=False, preprint=False)