<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
		<id>https://1984.lsi.us.es/wiki-egc/index.php?action=history&amp;feed=atom&amp;title=Pruebas_del_Modelo_21-22</id>
		<title>Pruebas del Modelo 21-22 - Historial de revisiones</title>
		<link rel="self" type="application/atom+xml" href="https://1984.lsi.us.es/wiki-egc/index.php?action=history&amp;feed=atom&amp;title=Pruebas_del_Modelo_21-22"/>
		<link rel="alternate" type="text/html" href="https://1984.lsi.us.es/wiki-egc/index.php?title=Pruebas_del_Modelo_21-22&amp;action=history"/>
		<updated>2026-06-29T15:08:28Z</updated>
		<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>https://1984.lsi.us.es/wiki-egc/index.php?title=Pruebas_del_Modelo_21-22&amp;diff=9092&amp;oldid=prev</id>
		<title>Ajramirez en 07:46 13 oct 2021</title>
		<link rel="alternate" type="text/html" href="https://1984.lsi.us.es/wiki-egc/index.php?title=Pruebas_del_Modelo_21-22&amp;diff=9092&amp;oldid=prev"/>
				<updated>2021-10-13T07:46:16Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='es'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revisión del 07:46 13 oct 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot; &gt;Línea 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Línea 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Implemente una prueba que cree una votación con una pregunta y dos opciones de respuesta.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Implemente una prueba que cree una votación con una pregunta y dos opciones de respuesta.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[link1]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ajramirez</name></author>	</entry>

	<entry>
		<id>https://1984.lsi.us.es/wiki-egc/index.php?title=Pruebas_del_Modelo_21-22&amp;diff=9084&amp;oldid=prev</id>
		<title>Ajramirez: Página creada con «Como vimos en las clase de teoría, para poder probar los elementos persistentes disponemos de las pruebas CRUD.  Es importante conocer que en Django los tests no se ejecut...»</title>
		<link rel="alternate" type="text/html" href="https://1984.lsi.us.es/wiki-egc/index.php?title=Pruebas_del_Modelo_21-22&amp;diff=9084&amp;oldid=prev"/>
				<updated>2021-10-08T16:21:18Z</updated>
		
		<summary type="html">&lt;p&gt;Página creada con «Como vimos en las clase de teoría, para poder probar los elementos persistentes disponemos de las pruebas CRUD.  Es importante conocer que en Django los tests no se ejecut...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Como vimos en las clase de teoría, para poder probar los elementos persistentes disponemos de las pruebas CRUD. &lt;br /&gt;
Es importante conocer que en Django los tests no se ejecutan sobre la misma base de datos que la que usamos en producción, por lo que los elementos que creemos no permanecerán en nuestra instalación de producción.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
def setUp(self):&lt;br /&gt;
        super().setUp()&lt;br /&gt;
        self.census = Census(voting_id=1, voter_id=1)&lt;br /&gt;
        self.census.save()&lt;br /&gt;
&lt;br /&gt;
def tearDown(self):&lt;br /&gt;
        super().tearDown()&lt;br /&gt;
        self.census = None&lt;br /&gt;
&lt;br /&gt;
def test_store_census(self):&lt;br /&gt;
        self.assertEqual(Census.objects.count(), 1)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
También hay otros métodos que se definen en los modelos y que puede tener sentido quere probar aunque no persistan datos, como por ejempo __str__ de voting. El siguiente método lo podemos añadir dentro de la clase de test de Voting y utilizar sus métodos auxiliares como el &amp;quot;create_voting()&amp;quot;. Es método añade varias opciones con el nombre &amp;quot;opción ''i'' (''i+1'')&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
def test_Voting_toString(self):&lt;br /&gt;
        v = self.create_voting()&lt;br /&gt;
        self.assertEquals(str(v),&amp;quot;test voting&amp;quot;)&lt;br /&gt;
        self.assertEquals(str(v.question),&amp;quot;test question&amp;quot;)&lt;br /&gt;
        self.assertEquals(str(v.question.options.all()[0]),&amp;quot;option 1 (2)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ejercicio 1'''&lt;br /&gt;
&lt;br /&gt;
Implemente una prueba que cree una votación con una pregunta y dos opciones de respuesta.&lt;/div&gt;</summary>
		<author><name>Ajramirez</name></author>	</entry>

	</feed>