# Path: accounts/models.py
# class UserProfile(models.Model, StatsFromChallengesMixin):
#     objects = UserProfileQuerySet.as_manager()
# 
#     team = models.ForeignKey('accounts.Team', null=True, blank=True, on_delete=models.CASCADE)
#     user = models.OneToOneField(User, related_name='profile', on_delete=models.CASCADE)
#     created_at = models.DateTimeField(auto_now_add=True)
#     image = models.FileField(upload_to='accounts/', default='accounts/user.png')
#     job = models.CharField(max_length=255)
#     gender = models.CharField(max_length=1, choices=(('M', 'Male'), ('F','Female')))
#     website = models.CharField(max_length=255, null=True, blank=True)
#     country = models.ForeignKey(Country, on_delete=models.CASCADE)
#     skills = models.TextField(null=True, blank=True)
# 
#     @property
#     def skill_list(self):
#         return self.skills.split(SKILLS_SEPARATOR) if self.skills else []
# 
#     def __str__(self):
#         return '{}, Team: {}'.format(self.user.username, self.team)
# 
#     @property
#     def failed_challenges(self):
#         return self._all_failed_challenges.exclude(pk__in=self.solved_challenges.all())


from cities_light.models import Country
from django.contrib.auth import get_user_model
from django.test import TestCase, Client, SimpleTestCase
from django.urls.base import reverse
from accounts.models import UserProfile



class RegistrationTestCase(TestCase, SimpleTestCase):
    def setUp(self):
        self.client = Client()
        self.user = get_user_model().objects.create_user(
            'username',
            'username@username.it',
            'u1u2u3u4'
        )
        self.tmp_user = get_user_model().objects.create_user(
            'temporary',
            'temporary@temporary.com',
            'temporary'
        )
        self.user_no_team = get_user_model().objects.create_user(
            'user_no_team',
            'user_no_team@user_no_team.com',
            'user_no_team'
        )
        self.country = Country.objects.create(name='Italy')

# Path: accounts/models.py
# class UserProfile(models.Model, StatsFromChallengesMixin):
#     objects = UserProfileQuerySet.as_manager()
# 
#     team = models.ForeignKey('accounts.Team', null=True, blank=True, on_delete=models.CASCADE)
#     user = models.OneToOneField(User, related_name='profile', on_delete=models.CASCADE)
#     created_at = models.DateTimeField(auto_now_add=True)
#     image = models.FileField(upload_to='accounts/', default='accounts/user.png')
#     job = models.CharField(max_length=255)
#     gender = models.CharField(max_length=1, choices=(('M', 'Male'), ('F','Female')))
#     website = models.CharField(max_length=255, null=True, blank=True)
#     country = models.ForeignKey(Country, on_delete=models.CASCADE)
#     skills = models.TextField(null=True, blank=True)
# 
#     @property
#     def skill_list(self):
#         return self.skills.split(SKILLS_SEPARATOR) if self.skills else []
# 
#     def __str__(self):
#         return '{}, Team: {}'.format(self.user.username, self.team)
# 
#     @property
#     def failed_challenges(self):
#         return self._all_failed_challenges.exclude(pk__in=self.solved_challenges.all())


# Path: accounts/tests.py
from cities_light.models import Country
from django.contrib.auth import get_user_model
from django.test import TestCase, Client, SimpleTestCase
from django.urls.base import reverse
from accounts.models import UserProfile




class RegistrationTestCase(TestCase, SimpleTestCase):
    def setUp(self):
        self.client = Client()
        self.user = get_user_model().objects.create_user(
            'username',
            'username@username.it',
            'u1u2u3u4'
        )
        self.tmp_user = get_user_model().objects.create_user(
            'temporary',
            'temporary@temporary.com',
            'temporary'
        )
        self.user_no_team = get_user_model().objects.create_user(
            'user_no_team',
            'user_no_team@user_no_team.com',
            'user_no_team'
        )
        self.country = Country.objects.create(name='Italy')

        UserProfile.objects.create(