<commit_before>"""
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.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.conf import settings

import csv, json
import pprint
import sqlite3, random
from datetime import datetime, timedelta

from shoppleyuser.utils import parse_phone_number
from shoppleyuser.models import ShoppleyUser, Country, Region, City, ZipCode, Merchant, Customer, Category
from offer.models import Offer, OfferCode


class SimpleTest(TestCase):

	def runTest(self):
		pass

	def setUp(self):
		self.pp = pprint.PrettyPrinter(indent=2)
		self.f = open("/tmp/shoppley.test.out.txt", "w")

		us, created = Country.objects.get_or_create(name="United States", code="US")
		region, created = Region.objects.get_or_create(name="Massachusetts", code="MA", country=us)
		city, created = City.objects.get_or_create(name="Cambridge", region=region)
		zipcode1, created = ZipCode.objects.get_or_create(code="02139", city=city)
		zipcode3, created = ZipCode.objects.get_or_create(code="02142", city=city)
		city, created = City.objects.get_or_create(name="Boston", region=region)
		zipcode2, created = ZipCode.objects.get_or_create(code="02250", city=city)

		# create users
		u, created = User.objects.get_or_create(username="<EMAIL>")
		u.email="<EMAIL>"
		u.set_password("<PASSWORD>")
		u.save()
		
		num = parse_phone_number("6176829602")
		if not Customer.objects.filter(user=u).exists():
			c, created = Customer.objects.get_or_create(user=u, address_1="", address_2="", zipcode=zipcode1, phone=num, balance=1000)
			c.active = True
			c.verified = True
			c.save()
		
		u, created = User.objects.get_or_create(username="<EMAIL>")
		u.email="<EMAIL>"
		u.set_password("<PASSWORD>")
		u.save()
		
		num = parse_phone_number("6179092101")
		if not Customer.objects.filter(user=u).exists():
			c, created = Customer.objects.get_or_create(user=u, address_1="15 Franklin St.", address_2="", zipcode=zipcode1, phone=num, balance=1000)
			c.active = True
			c.verified = True
			c.save()

		u, created = User.objects.get_or_create(username="<EMAIL>")
		u.email="<EMAIL>"
		u.set_password("<PASSWORD>")<commit_msg>Added kwan's additional google voice instead of regular phone number<commit_after>"""
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.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.conf import settings

import csv, json
import pprint
import sqlite3, random
from datetime import datetime, timedelta

from shoppleyuser.utils import parse_phone_number
from shoppleyuser.models import ShoppleyUser, Country, Region, City, ZipCode, Merchant, Customer, Category
from offer.models import Offer, OfferCode


class SimpleTest(TestCase):

	def runTest(self):
		pass

	def setUp(self):
		self.pp = pprint.PrettyPrinter(indent=2)
		self.f = open("/tmp/shoppley.test.out.txt", "w")

		us, created = Country.objects.get_or_create(name="United States", code="US")
		region, created = Region.objects.get_or_create(name="Massachusetts", code="MA", country=us)
		city, created = City.objects.get_or_create(name="Cambridge", region=region)
		zipcode1, created = ZipCode.objects.get_or_create(code="02139", city=city)
		zipcode3, created = ZipCode.objects.get_or_create(code="02142", city=city)
		city, created = City.objects.get_or_create(name="Boston", region=region)
		zipcode2, created = ZipCode.objects.get_or_create(code="02250", city=city)

		# create users
		u, created = User.objects.get_or_create(username="<EMAIL>")
		u.email="<EMAIL>"
		u.set_password("<PASSWORD>")
		u.save()
		
		num = parse_phone_number("6176829602")
		if not Customer.objects.filter(user=u).exists():
			c, created = Customer.objects.get_or_create(user=u, address_1="", address_2="", zipcode=zipcode1, phone=num, balance=1000)
			c.active = True
			c.verified = True
			c.save()
		
		u, created = User.objects.get_or_create(username="<EMAIL>")
		u.email="<EMAIL>"
		u.set_password("<PASSWORD>")
		u.save()
		
		num = parse_phone_number("6174538710")
		if not Customer.objects.filter(user=u).exists():
			c, created = Customer.objects.get_or_create(user=u, address_1="15 Franklin St.", address_2="", zipcode=zipcode1, phone=num, balance=1000)
			c.active = True
			c.verified = True
			c.save()

		u, created = User.objects.get_or_create(username="<EMAIL>")
		u.email="<EMAIL>"
		u.set_password("<PASSWORD>")
{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.02307850813929528, 'mean_word_length': 5.437665782493369, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1357773', 'n_tokens_mistral': 1771, 'n_tokens_neox': 1577, 'n_words': 376}