Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aditnryn committed May 2, 2015
1 parent 165f5f8 commit a1ae069
Showing 1 changed file with 72 additions and 2 deletions.
74 changes: 72 additions & 2 deletions aldryn_wow/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,75 @@ def create_superuser(self):
self.su_password
)

def test_animation(self):
pass
def test_animation_simple(self):
self.client.login(username=self.su_username, password=self.su_password)

plugin = api.add_plugin(
self.placeholder,
AnimationPlugin,
self.language,
animation_class='fadeInDown',
)
self.page.publish(self.language)
url = self.page.get_absolute_url()
response = self.client.get(url)

self.assertContains(response, 'animate')
self.assertEqual(plugin.__str__(), 'fadeInDown')

def test_animation_infinite(self):
self.client.login(username=self.su_username, password=self.su_password)

plugin = api.add_plugin(
self.placeholder,
AnimationPlugin,
self.language,
animation_class='bounce',
infinite=True,
)
self.page.publish(self.language)
url = self.page.get_absolute_url()
response = self.client.get(url)

self.assertContains(response, 'animate')
self.assertContains(response, 'bounce')
self.assertContains(response, 'infinite')

def test_wow_animation_simple(self):
self.client.login(username=self.su_username, password=self.su_password)

plugin = api.add_plugin(
self.placeholder,
RevealAnimationPlugin,
self.language,
animation_class='bounce',
)
self.page.publish(self.language)
url = self.page.get_absolute_url()
response = self.client.get(url)
self.assertContains(response, 'wow')
self.assertEqual(plugin.__str__(), 'wow bounce')

def test_wow_animation_all(self):
self.client.login(username=self.su_username, password=self.su_password)

plugin = api.add_plugin(
self.placeholder,
RevealAnimationPlugin,
self.language,
animation_class='fadeInLeft',
duration=1,
delay=2,
offset=3,
iteration=4
)
self.page.publish(self.language)
url = self.page.get_absolute_url()
response = self.client.get(url)

self.assertContains(response, 'wow')
self.assertContains(response, 'fadeInLeft')
self.assertContains(response, 'data-wow-duration="1s"')
self.assertContains(response, 'data-wow-delay="2s"')
self.assertContains(response, 'data-wow-offset="3"')
self.assertContains(response, 'data-wow-iteration="4"')

0 comments on commit a1ae069

Please sign in to comment.