# 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 = User.objects.create_user('testuser', 'blah@blah.com', 'testpassword')
        self.test_user.is_superuser = True
        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_authordetail_minimum(self):
        '''This test creates a :class:`~papers.models.AuthorDetails` with the required information only.'''
        test_authordetail = AuthorDetails(author=Person.objects.get(pk=1), 
            order = 1, corresponding_author=True, equal_contributors=False)
        test_authordetail.save()
        
    def test_create_new_authordetail_all(self):
        '''This test creates a :class:`~papers.models.AuthorDetails` with the required information only.'''
        test_authordetail = AuthorDetails(author=Person.objects.get(pk=1), 
            order = 1,
            corresponding_author = True,
            equal_contributors = True)
        test_authordetail.save()             
            
    def test_authordetail_unicode(self):
        '''This tests that the unicode representaton of an :class:`~papers.models.AuthorDetails` object is correct.'''

# 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 = User.objects.create_user('testuser', 'blah@blah.com', 'testpassword')
        self.test_user.is_superuser = True
        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_authordetail_minimum(self):
        '''This test creates a :class:`~papers.models.AuthorDetails` with the required information only.'''
        test_authordetail = AuthorDetails(author=Person.objects.get(pk=1), 
            order = 1, corresponding_author=True, equal_contributors=False)
        test_authordetail.save()
        
    def test_create_new_authordetail_all(self):
        '''This test creates a :class:`~papers.models.AuthorDetails` with the required information only.'''
        test_authordetail = AuthorDetails(author=Person.objects.get(pk=1), 
            order = 1,
            corresponding_author = True,
            equal_contributors = True)
        test_authordetail.save()             
            
    def test_authordetail_unicode(self):
        '''This tests that the unicode representaton of an :class:`~papers.models.AuthorDetails` object is correct.'''

        test_authordetail = AuthorDetails(author=Person.objects.get(pk=1), 