# Path: wbc/process/models.py
# class Place(Model):
#     identifier  = models.CharField(blank=True, max_length=64, verbose_name="Bezeichner", help_text="ggf. Bezeichner des Beplauungsplans")
#     address     = models.CharField(max_length=256, blank=True, verbose_name="Adresse", help_text="Eine genaue Adresse des Vorhabens")
#     description = models.TextField(blank=True, verbose_name="Beschreibung", help_text="Örtliche Beschreibung")
#     entities    = models.ManyToManyField(Entity, blank=True, verbose_name="Einheit", related_name='places')
#     lat         = models.FloatField(verbose_name="Breitengrad")
#     lon         = models.FloatField(verbose_name="Längengrad")
#     polygon     = models.TextField(null=True, blank=True)
#     active      = models.BooleanField()
#     link        = models.URLField(blank=True)
# 
#     def get_absolute_url(self):
#         return reverse('place', kwargs={'pk': self.pk})
# 
#     def get_update_url(self):
#         return reverse('place_update', kwargs={'pk': self.pk})
# 
#     def get_delete_url(self):
#         return reverse('place_delete', kwargs={'pk': self.pk})
# 
#     def __str__(self):
#         strings = []
#         if self.identifier:
#             strings.append(self.identifier)
#         if self.address:
#             strings.append(self.address)
# 
#         return ', '.join(strings)
# 
#     def __unicode__(self):
#         return unicode(self.__str__())
# 
#     class Meta:
#         ordering            = ("-created",)
#         verbose_name        = "Ort"
#         verbose_name_plural = "Orte"
# 
# Path: wbc/region/models.py
# class District(Entity):
#     muncipality = models.ForeignKey(Muncipality, related_name='districts')
# 
#     class Meta:
#         verbose_name = 'Bezirk'
#         verbose_name_plural = 'Bezirke'
# 
# Path: wbc/region/models.py
# class Muncipality(Entity):
# 
#     class Meta:
#         verbose_name = 'Gemeinde'
#         verbose_name_plural = 'Gemeinden'
# 
# Path: wbc/comments/models.py
# class Comment(Model):
#     place = models.ForeignKey(Place, verbose_name="Ort")
#     author_name = models.CharField(
#         max_length=100, verbose_name="Autorin/Author")
#     author_email = models.CharField(max_length=256, verbose_name="Email")
#     author_url = models.CharField(
#         max_length=256, blank=True, verbose_name="Url")
# 
#     enabled = models.BooleanField(verbose_name="Freigeschaltet")
#     content = models.TextField(verbose_name="Inhalt")
# 
#     @property
#     def gravatar(self):
#         gravatar_url = "http://www.gravatar.com/avatar/" + \
#             hashlib.md5(self.author_email.lower()).hexdigest() + "?"
#         gravatar_url += urlencode({'s': str(32)})
# 
#         return gravatar_url
# 
#     def __str__(self):
#         return str(self.place) + ', ' + self.author_name
# 
#     def __unicode__(self):
#         return unicode(self.__str__())
# 
#     class Meta:
#         ordering = ("created",)
#         verbose_name = "Kommentar"
#         verbose_name_plural = "Kommentare"


from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from wbc.process.models import Place
from wbc.region.models import District
from wbc.region.models import Muncipality
from .models import Comment
        from six.moves.urllib_parse import urlencode
        import hashlib
# -*- coding: utf-8 -*-




class CommentTestCase(TestCase):

    def setUp(self):

        Muncipality(name='Berlin').save()

        district = District(
            name='Mitte',

# Path: wbc/process/models.py
# class Place(Model):
#     identifier  = models.CharField(blank=True, max_length=64, verbose_name="Bezeichner", help_text="ggf. Bezeichner des Beplauungsplans")
#     address     = models.CharField(max_length=256, blank=True, verbose_name="Adresse", help_text="Eine genaue Adresse des Vorhabens")
#     description = models.TextField(blank=True, verbose_name="Beschreibung", help_text="Örtliche Beschreibung")
#     entities    = models.ManyToManyField(Entity, blank=True, verbose_name="Einheit", related_name='places')
#     lat         = models.FloatField(verbose_name="Breitengrad")
#     lon         = models.FloatField(verbose_name="Längengrad")
#     polygon     = models.TextField(null=True, blank=True)
#     active      = models.BooleanField()
#     link        = models.URLField(blank=True)
# 
#     def get_absolute_url(self):
#         return reverse('place', kwargs={'pk': self.pk})
# 
#     def get_update_url(self):
#         return reverse('place_update', kwargs={'pk': self.pk})
# 
#     def get_delete_url(self):
#         return reverse('place_delete', kwargs={'pk': self.pk})
# 
#     def __str__(self):
#         strings = []
#         if self.identifier:
#             strings.append(self.identifier)
#         if self.address:
#             strings.append(self.address)
# 
#         return ', '.join(strings)
# 
#     def __unicode__(self):
#         return unicode(self.__str__())
# 
#     class Meta:
#         ordering            = ("-created",)
#         verbose_name        = "Ort"
#         verbose_name_plural = "Orte"
# 
# Path: wbc/region/models.py
# class District(Entity):
#     muncipality = models.ForeignKey(Muncipality, related_name='districts')
# 
#     class Meta:
#         verbose_name = 'Bezirk'
#         verbose_name_plural = 'Bezirke'
# 
# Path: wbc/region/models.py
# class Muncipality(Entity):
# 
#     class Meta:
#         verbose_name = 'Gemeinde'
#         verbose_name_plural = 'Gemeinden'
# 
# Path: wbc/comments/models.py
# class Comment(Model):
#     place = models.ForeignKey(Place, verbose_name="Ort")
#     author_name = models.CharField(
#         max_length=100, verbose_name="Autorin/Author")
#     author_email = models.CharField(max_length=256, verbose_name="Email")
#     author_url = models.CharField(
#         max_length=256, blank=True, verbose_name="Url")
# 
#     enabled = models.BooleanField(verbose_name="Freigeschaltet")
#     content = models.TextField(verbose_name="Inhalt")
# 
#     @property
#     def gravatar(self):
#         gravatar_url = "http://www.gravatar.com/avatar/" + \
#             hashlib.md5(self.author_email.lower()).hexdigest() + "?"
#         gravatar_url += urlencode({'s': str(32)})
# 
#         return gravatar_url
# 
#     def __str__(self):
#         return str(self.place) + ', ' + self.author_name
# 
#     def __unicode__(self):
#         return unicode(self.__str__())
# 
#     class Meta:
#         ordering = ("created",)
#         verbose_name = "Kommentar"
#         verbose_name_plural = "Kommentare"


# Path: wbc/comments/tests.py
from django.test import TestCase
from django.test import Client
from django.core.urlresolvers import reverse
from wbc.process.models import Place
from wbc.region.models import District
from wbc.region.models import Muncipality
from .models import Comment
        from six.moves.urllib_parse import urlencode
        import hashlib

# -*- coding: utf-8 -*-




class CommentTestCase(TestCase):

    def setUp(self):

        Muncipality(name='Berlin').save()

        district = District(
            name='Mitte',

            muncipality=Muncipality.objects.get(name='Berlin')